-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unmarshall graphql query to use it with graphb #8
Comments
@hubyhuby It looks like you want to parse a query to an AST. You might be able to use some function in graph gopher. I don't know if Udacity is still maintaining this lib. I don't work for Udacity anymore. Can't really help you on this. |
@CreatCodeBuild Thanks for your help, |
@hubyhuby You are welcome. But here is my warning. I basically wrote the whole library on an airplane with no internet. I took lots of short cuts and didn't follow the exact GraphQL spec. I didn't understand GraphQL's AST enough at that time. This library was definitely a nice try. Here are the pros and cons: Pros: Cons: According to your description, it's likely that you need to dynamically compose an AST so that this lib might be the right one. If I can squeeze some time next year, I will love to continue this work on my fork or just write a new one because many API could be redesigned. As I now work fulltime as a GraphQL infrastructure engineer (in JS though), I have much deeper understanding of GraphQL now. For example, I probably should consider using AST from https://github.com/vektah/gqlparser or https://github.com/graph-gophers/graphql-go instead of reimplementing the AST. It's likely that I will use However, I may not have time to do this work anytime soon because
Of course, the second half of this message has nothing to do with your feature request. Just want to provide you more context. Good luck and Merry Christmas! |
Feature request :
The use case of this, is when you build a Go API that receives a graphql query that you want to validate and modify before passing it to your graph DB.
Basically :
you receive a string as mentionned in your example :
const queryTemplate =
"query": "
query an_operation_name {
a_field_name (`
You want to marshall it to graphb. And modify it.
3)Marshall it and send it to the graph DB.
Thanks you for this library.
The text was updated successfully, but these errors were encountered: