deno-libs / graphql_tag

🦕 Create a GraphQL schema AST from template literal. Deno port of `graphql-tag` library

Home Page:https://deno.land/x/graphql_tag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/graphql@16.6.0'
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 }))

About

🦕 Create a GraphQL schema AST from template literal. Deno port of `graphql-tag` library

https://deno.land/x/graphql_tag

License:MIT License


Languages

Language:TypeScript 100.0%