You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
I'm encountering an issue while trying to define an array of strings in my Lighthouse GraphQL schema. I have a mutation called createTrainer where I want to include a field named languages which should simply be an array of strings. However, Lighthouse seems to be interpreting it as a relation instead of a simple array of strings.
Expected Behavior:
I expect the field languages to be treated as a simple array of strings (and stored as json in db).
Actual Behavior:
"extensions": {
"debugMessage": "Nuwave\\Lighthouse\\Execution\\Arguments\\ArgPartitioner::nestedArgResolvers(): Argument #1 ($argumentSet) must be of type Nuwave\\Lighthouse\\Execution\\Arguments\\ArgumentSet, array given, called in \/var\/www\/html\/vendor\/nuwave\/lighthouse\/src\/Execution\/Arguments\/ResolveNested.php on line 25",
"file": "\/var\/www\/html\/vendor\/nuwave\/lighthouse\/src\/Execution\/Arguments\/ArgPartitioner.php",
"line": 23,
...
Attempts to Resolve:
I've tried defining a custom directive @arrayOfString to explicitly specify that languages should be treated as an array of strings, but it didn't resolve the issue.
Additional Information:
Laravel version: 10.10
Lighthouse-PHP version: 6.10
I'd appreciate any guidance or suggestions on how to resolve this issue. Thanks in advance for your help!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Description:
I'm encountering an issue while trying to define an array of strings in my Lighthouse GraphQL schema. I have a mutation called createTrainer where I want to include a field named languages which should simply be an array of strings. However, Lighthouse seems to be interpreting it as a relation instead of a simple array of strings.
Schema Definition:
Expected Behavior:
I expect the field languages to be treated as a simple array of strings (and stored as json in db).
Actual Behavior:
Attempts to Resolve:
I've tried defining a custom directive @arrayOfString to explicitly specify that languages should be treated as an array of strings, but it didn't resolve the issue.
Additional Information:
Laravel version: 10.10
Lighthouse-PHP version: 6.10
I'd appreciate any guidance or suggestions on how to resolve this issue. Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions