Closed autsada closed 4 years ago
Hi @autsada Here is the right solution and you can find more information here.
Hi arronwlee,
Thank you for your quick reply. Actually I used apollo on the frontend, and I have defined my query on the frontend same way as your example. Here is my code.
query ME($userId: String!) {
me(userId: $userId) {
id
username
email
roles
created_at
}
}
I think it is not because of the frontend, which I also have tested the same code with my other Graphql API made in Node.js and it works fine.
I have tested your example code using a variable in the playground, it works when I enter the argument directly, but it doesn't when I put it as a variable. Please see the screenshots below.
as far as mine is working fine
I think you're using the wrong version...
can you try to reload the module or use the 0.2 version? https://deno.land/x/oak_graphql@0.2/mod.ts
let me know if you got the same error after reloading it. I can make a new version branch for you.
Yes, that may cause the problem. I will test it and will update you soonest.
Thank for your help :)
Hi @aaronwlee
Yes, the wrong version was indeed cause a problem. Now it works.
Thank you very much for your time.
Hi
I finished making the API, it works well in the playground and now I connected this API to the frontend. The queries that don't require variables work, but the queries and mutations that require variables don't work.
I have tested both with my next.js frontend and postman.
Here are screenshots from using postman.