Skip to content

Instantly share code, notes, and snippets.

@yvesbou
Created February 18, 2022 09:32
Show Gist options
  • Save yvesbou/3375db56e574d989b28b78d09c9b2c98 to your computer and use it in GitHub Desktop.
Save yvesbou/3375db56e574d989b28b78d09c9b2c98 to your computer and use it in GitHub Desktop.
// graphQL wrapper
const {gql} = require("apollo-server");
// this graphlQL wrapper basically lets us create a graphQL schema which will be interpreted from a javascript string
module.exports = gql`
type ERC20Coin{
id: ID!
name: String!
}
type Query{
coins: [ERC20Coin]
}
input CreateERC20CoinInput{
name: String!
}
input UpdateERC20CoinInput{
name: String
}
type DeletePayload{
id: ID!
}
type Mutation{
createCoin(input: CreateERC20CoinInput!): ERC20Coin!
updateCoin(id: ID, input: UpdateERC20CoinInput!): ERC20Coin!
deleteCoin(id: ID): DeletePayload!
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment