Skip to content
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

Writing mutations with null values in relations #1436

Open
joskfg opened this issue Jun 17, 2020 · 0 comments
Open

Writing mutations with null values in relations #1436

joskfg opened this issue Jun 17, 2020 · 0 comments
Labels
needs reproduction Failing test case needed

Comments

@joskfg
Copy link
Collaborator

joskfg commented Jun 17, 2020

Describe the bug

If you tries to execute a mutation with a null value in a relation, the mutation fails. It could be regression over #1021.

Expected behavior/Solution

The mutation should work without working with the relation

Steps to reproduce

This mutation variables will work:

{
  "book": { 
    "upsert": [
      {
       "title": "test",
        "chapter": {
         "upsert": [{ "something": "value"}]
       }
      }
     ]
  }
}

This mutation variables won't work:

{
  "book": { 
    "upsert": [
      {
       "title": "test",
        "chapter": null
      }
     ]
  }
}

This mutation variables will work:

{
  "book": { 
    "upsert": [
      {
       "title": "test",
      }
     ]
  }
}

Output/Logs

Click to expand

{"message":"Argument 1 passed to Nuwave\\Lighthouse\\Execution\\Arguments\\ArgPartitioner::nestedArgResolvers() must be an instance of Nuwave\\Lighthouse\\Execution\\Arguments\\ArgumentSet, null given, called in /opt/app/vendor/nuwave/lighthouse/src/Execution/Arguments/ResolveNested.php on line 33","context":{"exception":{"class":"TypeError","message":"Argument 1 passed to Nuwave\\Lighthouse\\Execution\\Arguments\\ArgPartitioner::nestedArgResolvers() must be an instance of Nuwave\\Lighthouse\\Execution\\Arguments\\ArgumentSet, null given, called in /opt/app/vendor/nuwave/lighthouse/src/Execution/Arguments/ResolveNested.php on line 33","code":0,"file":"/opt/app/vendor/nuwave/lighthouse/src/Execution/Arguments/ArgPartitioner.php:26"}},"level":400,"level_name":"ERROR","channel":"testing","datetime":"2020-06-17T12:29:48.107377+00:00","extra":{}}


Lighthouse Version

4.14.1

@spawnia spawnia added the needs reproduction Failing test case needed label Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction Failing test case needed
Projects
None yet
Development

No branches or pull requests

2 participants