-
Notifications
You must be signed in to change notification settings - Fork 3
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
GraphQL directives not applied #16
Comments
Hi @aenawi, thanks for trying fastgql, is super early lib as you can see it doesn't have tests. I will take a look why the directive didn't work correctly and get back to you. |
Hi, I found out what was causing the problem, the result type of users needs to be the same as the type its querying i.e Note: that this library is really in the start and I still need to add support for adding more complex filter support. GraphQL schema I used to check your problem.
Hope this helps, if you like this project, feel free to contribute, ill be more than happy to merge features/get feature requests you might want |
Thanks, yes I've noticed no tests available, just got curious to give it a try ;) I like when smart developers think in different ways. Anyways, so far these are the results from what I understood: First, after making the changes you mentioned above, yes the query got corrected, but still I've received this error from GraphQL:
and when I debugged the Users resolver in (shema.fastgql.go) file, I've noticed that sql.NewBuilder created the following query which looks a bit confusing and it didn't accept "myapp.user_profile" (with quotes) in the sql statement! To test it I've copied the statement and ran it under PgAdmin console and "myapp.user_profile" (with quotes) was highlighted as an error. I removed the quotes and it did accept it but couldn't continue because of the rest LEFT JOIN LATERAL (FROM "userID") - that which I don't understand at this stage!
another thing I've noticed from last LEFT JOIN LATERAL, why the name of the table in the FROM showing (nationality) and not (country) since Country was the type defined in the GraphQL schema for UserProfile! Any ways, I stopped at the confusing part where the Executor.Query is not able to execute the statement built using sql.NewBuilde, b'cos of all those quotes and aliases! Do I need to reconfigure my PostgrSQL DB or something?! I think I should wait for a while until you create some more examples, or add unit tests. Thank you for all your efforts |
Hi sorry for taking so long to reply, I added a argument to the Started adding tests as well so hopefully ill get around to stabilizing the code some more and test more usecases. |
Fixed in #18 the |
Hi
I'm trying to apply fastgql directive (@tableName) in my graphql schema file like so:
...and declared my GraphQL Query like so:
The problem:
When I run the GraphQL playground and try my query statement like this:
I receive this error:
It looks like it's still using the Query type name and not the actual TableName as defined in the schema using @tableName directive!
Any ides please?!
The text was updated successfully, but these errors were encountered: