Last active
September 22, 2021 18:58
-
-
Save morus12/15bdaec26be5b9a7cbbcbd8fe2879152 to your computer and use it in GitHub Desktop.
schema.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directive @auth( | |
requires: String, | |
) on FIELD_DEFINITION | |
type Query { | |
getPerson(id: ID!): Person! @auth(requires: "policy-id") | |
allPersons(last: Int): [Person!]! | |
allPosts(last: Int): [Post!]! | |
search(text: String): [SearchResult] | |
searchID(text: String): [PlainID] | |
} | |
type Mutation { | |
createPerson(name: String!, age: Int!): Person! @auth(requires: "mutation-policy-id") | |
updatePerson(id: ID!, name: String!, age: String!): Person! | |
deletePerson(id: ID!): Person! | |
} | |
type Subscription { | |
newPerson: Person! | |
} | |
type Person { | |
id: ID! | |
name: String! | |
age: Int! | |
posts: [Post!]! | |
sex: Sex | |
} | |
type Post { | |
id: ID! | |
title: String! | |
author: Person! | |
} | |
union SearchResult = Person | Post | |
enum Sex { | |
MALE | |
FEMALE | |
OTHER | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment