Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.43 KB

README.md

File metadata and controls

38 lines (27 loc) · 1.43 KB

graphql-tag

GitHub release (latest by date) GitHub Workflow Status Codecov

🦕 Deno port of graphql-tag library.

Create a GraphQL schema AST from template literal.

Example

import { buildASTSchema, graphql } from 'https://esm.sh/[email protected]'
import { gql } from 'https://deno.land/x/graphql_tag/mod.ts'

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

const query = `{ hello }`

const resolvers = { hello: () => 'world' }

const schema = buildASTSchema(typeDefs)

console.log(await graphql({ schema, source: query, rootValue: resolvers }))