Only "type" is allowed to defined in datamodel.graphql, Or can we define the input, query, mutation etc 🙂
🙂 1
n
nilan
04/26/2018, 12:36 PM
You can only define types and enums in the datamodel.
This is taken to generate a full blown GraphQL schema including input types, query, mutation, ... .
You can then setup a GraphQL Server where you define your own schema (types, input, query, mutation, ...) that uses the Prisma API under the hood. This is called schema stitching, and is super easy using
prisma-binding
.
j
john
04/26/2018, 2:03 PM
Thanks for your response. I started using the new 1.7 edition of the Prisma. Deployed with docker is fine, But auto generated prisma.graghql seems some issue with type "Subscription" functions. It auto creates
"dogs(where: DogsSubscriptionWhereInput): DogsSubscriptionPayload".
type DogsSubscriptionPayload {
mutation: MutationType!
node: Dogs
updatedFields: [String!]
previousValues: DogsPreviousValues
}
type DogsPreviousValues {
}
But DogsPreviousValues is empty makes error in playground.
{
"error": "DogsPreviousValues fields must be an object with field names as keys or a function which returns such an object."
}