Skip to main content
Module

x/graphql_deno/test.ts

GraphQL-JS ported to Deno
Latest
File
import { graphql, GraphQLSchema, GraphQLObjectType, GraphQLString,} from "./mod.ts";
const query = '{ hello }';
const schema = new GraphQLSchema({ query: new GraphQLObjectType({ name: 'RootQueryType', fields: { hello: { type: GraphQLString, resolve() { return 'world'; }, }, }, }),});
graphql(schema, query).then((result: any) => { // Prints // { // data: { hello: "world" } // } console.log(result);});