When I try to create a server I get an error. The server is created but without any relation to the user. Everything works fine locally. The error only appears in production.
Here’s my schemas:
schema
@auth(
providers: [
{ type: jwt, issuer: "nextauth", secret: "{{ env.NEXTAUTH_SECRET }}" }
]
rules: [{ allow: private }]
) {
query: Query
}
type User @model {
name: String!
email: Email! @unique
password: String
servers: [Server]
}
type Server @model {
name: String!
createdBy: User! @relation(name: "creator")
users: [User]!
}
And the query:
mutation ServerCreate {
serverCreate(
input: {
name: "server 1"
createdBy: {
link: "user_01HC7EKE3RX5GPTX9764V8C0TH"
}
users: [{
link: "user_01HC7EKE3RX5GPTX9764V8C0TH"
}]
}
) {
server {
name
createdBy {
name
}
id
users(first: 10) {
edges {
node {
name
}
}
}
}
}
}
The problem only appears in production, so it may be a configuration problem.