Skip to content

Instantly share code, notes, and snippets.

@mlg87
Last active July 21, 2020 20:57
Show Gist options
  • Save mlg87/9ad6a8374310cb1b4461a9d5bbefdf00 to your computer and use it in GitHub Desktop.
Save mlg87/9ad6a8374310cb1b4461a9d5bbefdf00 to your computer and use it in GitHub Desktop.
Using Apollo Client for global state management code samples - src_Balloon_schema.js
// src/Balloon/schema.js
const gql = require("graphql-tag");
module.exports = gql`
input BalloonInput {
color: String!
id: ID!
}
type Balloon {
color: String!
id: ID!
}
extend type Query {
selectedBalloon: Balloon!
}
extend type Mutation {
# this returns null, but graphql requires defining a type here
setSelectedBalloon(selectedBalloon: BalloonInput!): String
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment