Issue when passing nested structure #1558
Replies: 3 comments
-
I guess the issue is that you are using a mismatched key for the field: https://github.com/mstodulski/graphql-example/blob/e4ac5ae27699c10d23011fc854b66da221662a73/src/Struct/MutationType.php#L55 I strongly advise not hand-rolling your server implementation using this library directly. Consider using a framework such as https://github.com/nuwave/lighthouse. |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
I also noticed that if we change this line of code: |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've been using your library for a while and it's working great, but I hit a problem. When attempting to execute query with passing args to create an object that contains another object, which contains a collection of another objects, I receive a weird error message:
Field "arrayOfComplexObjectsLevel3" is not defined by type "complexObjectLevel2". Did you mean "arrayOfComplexObjectsLevel3"?
Problem can be reproduced using the code of service placed here:
https://github.com/mstodulski/graphql-example
and quering the service using curl from the command line:
curl http://localhost -H 'content-type: application/json' -d '{"query": "mutation { addComplexObject( name: \"Example complex object name\", complexObjectLevel2: { arrayOfComplexObjectsLevel3: [ { nameLevel3: \"Example level 3 name 1\" }, { nameLevel3: \"Example level 3 name 2\" }, { nameLevel3: \"Example level 3 name 3\" } ] } ) { name } }"}'
Could you help me with this? It seems to me this structure should be accepted according to the GraphQL standard.
Beta Was this translation helpful? Give feedback.
All reactions