Only "type" is allowed to defined in datamodel.gra...
# orm-help
j
Only "type" is allowed to defined in datamodel.graphql, Or can we define the input, query, mutation etc 🙂
🙂 1
n
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
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." }
n
Can you share your setup (datamodel, prisma.yml, ...) and the steps you are following in a new bug report here: https://github.com/graphcool/prisma/issues?
j
Can we say to omit the Subscription in auto generated prisma.graphql.
Any setup for to omit the auto generated Subscription in prisma.graphql
n
No.