Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A simple `types.gql` to define basic content types...
- ```graphql
- type Post @options("where", "limit", "order") {
- title: String!
- content: String
- }
- ```
- The resulting schema...
- ```graphql
- type Post {
- id: ID!
- title: String!
- content: String
- }
- type Posts {
- posts: [Post],
- count: Int
- }
- input postInput {
- title: String!
- content: String
- }
- type Query {
- post(id: ID!): Post
- posts(where: {}, order: {}, limit: {}): Posts
- }
- type Mutation {
- createPost(post: postInput): Post
- deletePost(postId: ID!): Post
- updatePost(postId: ID!, postInput): Post
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement