Skip to content

Instantly share code, notes, and snippets.

@maticzav
Last active October 3, 2020 13:47
Show Gist options
  • Save maticzav/da5aeabacc5679dda1fc473f6a405c9b to your computer and use it in GitHub Desktop.
Save maticzav/da5aeabacc5679dda1fc473f6a405c9b to your computer and use it in GitHub Desktop.
# src/schema.graphql
# import ID, File from "./generated/database.graphql"
# Everything user can read
type Query {
file(id: ID!): File # Takes id property as an argument and returns a File
files: [File!]! # Returns every file stored
}
# Everthing user can change
type Mutation {
renameFile(
id: ID! # An ID of the file to be changed
name: String! # A new name of the file
): File
deleteFile(
id: ID! # Id of the file to be deleted
): File
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment