Skip to main content
Module

x/graphql_tag/mod.ts>gql

🦕 Create a GraphQL schema AST from template literal. Deno port of `graphql-tag` library
Latest
function gql
import { gql } from "https://deno.land/x/graphql_tag@0.1.2/mod.ts";

Create a GraphQL AST from template literal

Examples

Example 1

import { buildASTSchema, graphql } from 'https://deno.land/x/graphql_deno@v15.0.0/mod.ts'
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' }

console.log(await graphql(buildASTSchema(typeDefs), query, resolvers))

Parameters

literals: string | readonly string[]
...args: any[]