Created
February 18, 2022 09:32
-
-
Save yvesbou/3375db56e574d989b28b78d09c9b2c98 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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