GraphQL query - get information from Rails server - wrong number of arguments (given 1, expected 0)

weijiren
New Member
1 0 0

Hi everyone.
I am new to app development and am looking to develop one with a Rails based server.
I followed this tutorial to create a first embedded app https://shopify.dev/tutorials/build-rails-react-app-that-uses-app-bridge-authentication.

Now..
I want to keep only one type of API, so GraphQL.
On the app side I can easily save the information entered (mutation) and retrieve it (query).

The problem I really can't figure out is because if I set the query with a parameter I get the message "wrong number of arguments (given 1, expected 0)."

If I don't set any arguments, everything is ok.
If I set 1 or more I always get the same message "wrong number of arguments (given 1, expected 0)."

I also tried to make the AuthenticatedController a normal ApplicationController (commenting include ShopifyApp :: Authenticated in authenticated_controller.rb and consequently empty object in context graphql_controller.rb) but nothing.
I always get the same message.

I'm fine with getting the results without parameters, but I wish I could filter queries for the single resource I want to get from the server.

Thank you so much

0 Likes