Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Latest commit

 

History

History
35 lines (26 loc) · 1.08 KB

README.md

File metadata and controls

35 lines (26 loc) · 1.08 KB

graphql_tools

GitHub release (latest by date)

DEPRECATED! Use https://esm.sh/@graphql-tools/schema instead.

Example

import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import { makeExecutableSchema } from 'https://esm.sh/@graphql-tools/schema'
import { GraphQLHTTP } from 'https://deno.land/x/[email protected]/mod.ts'
import { gql } from 'https://deno.land/x/[email protected]/mod.ts'

const typeDefs = gql`
  type Query {
    hello: String
  }
`

const resolvers = {
  Query: {
    hello: () => `Hello World!`
  }
}

const schema = makeExecutableSchema({ typeDefs, resolvers })

await serve(GraphQLHTTP({ schema, graphiql: true }), { port: 3000 })