Skip to main content
Module

x/kilatgraphql/mod.ts>gql

Graphql middleware
Latest
function gql
import { gql } from "https://deno.land/x/kilatgraphql@16.6.0-1/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[]