Skip to content

Instantly share code, notes, and snippets.

@daniele-zurico
Created June 8, 2018 15:33
Show Gist options
  • Select an option

  • Save daniele-zurico/79ed2ba391f17b6e51c04553d0405bde to your computer and use it in GitHub Desktop.

Select an option

Save daniele-zurico/79ed2ba391f17b6e51c04553d0405bde to your computer and use it in GitHub Desktop.
import {
addMockFunctionsToSchema,
gql,
makeExecutableSchema
} from "apollo-server";
import { GraphQLSchema } from "graphql";
const userSchema: GraphQLSchema = makeExecutableSchema({
typeDefs: gql`
type Query {
users: [User]
validateUser(idToken: String): User
}
type User {
_id: String
email: String
name: String
picture: String
given_name: String
family_name: String
locale: String
}
`
});
addMockFunctionsToSchema({ schema: userSchema });
export default userSchema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment