GraphQL extension schema

node v10.24.1
version: 1.0.0
endpointsharetweet
const { graphql } = require('graphql'); const { makeExecutableSchema } = require('graphql-tools'); const typeDefs = ` type Person { name: String! } extend type Person { salary: Int } type Query { person: Person } `; const resolvers = { Query: { person: () => ({ name: "John Doe", salary: 1234 }) } } const schema = makeExecutableSchema({ typeDefs, resolvers }); graphql(schema, ` { __schema { types { kind name fields { name type } } } } `).then(console.log);
Loading…

no comments

    sign in to comment