Replies: 4 comments
-
It won't work out of the box and when we started our project we had to define a structure and at the time there wasn't any standard for querying with pagination and stuff, so we decided to go with what made sense for us and was a good foundation for everyone to use. Since there wasn't any standard, it won't be a direct match with external GraphQL lib like the one you mentioned (first time I hear about it) and the only possible way would be to add a parser of some kind. The easiest is probably to extend the service like you mentioned, I revisited all my services at some point and made them all as So you probably want to extend the service, you could also eventually choose to add your port into Slickgrid-Universal as another optional package without impacting other users (that's the beauty of a monorepo). |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response! I will give it a shot. If I come up with something that others can use, I will submit it. Is there a standard now? I did not see one. |
Beta Was this translation helpful? Give feedback.
-
I'll turn this as a Discussion since it's not really an issue and is better to discuss |
Beta Was this translation helpful? Give feedback.
-
I did start the project and implemented all the interfaces into new classes, copied the implementation from your work. Was able to make some minor changes successfully, then hit a wall on the order by and filters implementation. I mainly work on backend systems, and I realized my typescript skills need to be updated and it would take me more time than I have to do it. I have tabled it for now and will have another team member look at it in the coming weeks. |
Beta Was this translation helpful? Give feedback.
-
Customize Graphql
Your Environment
Context
I am using Hot Chocolate 12.5 and they have a different syntax for sorting, paging and I assume filtering. I have not got to filtering with the grid yet. Hot chocolate is getting popular and is easy to use.
Here is a sample query that has skip and take instead of offset and limit. I was able to get replace these with little effort. Also, was able to make a new object from the result to change the return type to nodes instead of items.
query { connections( skip: 0 take: 50 order: { createdDate: ASC, user: {name: DESC}} ) { totalCount items { createdDate user { name } } } }
They use order instead of orderby, which will be easy to replace as well. The rest is a little harder, with the differences in complex object sorting and the syntax in general.
Here is an example of what I see being requested by the grid
query { connections (offset:0,first:50,orderBy:[{field:phoneNumber,direction:ASC}]) { totalCount, nodes { id,createdDate,phoneNumber,to,from } } }
Possible Solution
Is there a way to override or extend the current implementation of the GraphqlService?
Are there any plans to support the default syntax from Hot Chocolate?
Thank you for working on this repo.
Beta Was this translation helpful? Give feedback.
All reactions