So, I'm getting the following error on permissions...
# orm-help
t
So, I'm getting the following error on permissions:
Copy code
{
  "data": null,
  "errors": [
    {
      "message": "Cannot return null for non-nullable field User.permissions.",
      "locations": [
        {
          "line": 14,
          "column": 5
        }
      ],
      "path": [
        "signin",
        "permissions"
      ]
    }
  ]
}
when attempting to run the following mutation. What am I overlooking:
Copy code
mutation SIGNIN_MUTATION($email: String!, $password: String!, $pathname: String!) {
    signin(email: $email, password: $password, pathname: $pathname) {
    id
    name
    email
    permissions
  }
}
based on the following schema and datamodel schema
Copy code
type Mutation {
    signin(email: String!, password: String!, pathname: String!): User!
}
datamodel
Copy code
type User {
  id: ID! @unique
  name: String!
  email: String! @unique
  password: String!
  resetToken: String
  resetTokenExpiry: String
  permissions: [Permission]
  cart: [CartItem!]!
}
m
When I've seen this in the past it's due to the fact that the query is in fact returning an Array - try changing your Mutation type to return [User!]! to validate this. If true you can chose to alter your query or retrieve array.
Copy code
type Mutation {
    signin(email: String!, password: String!, pathname: String!): [User!]!
}
t
@nilan Any ideas?