Skip to main content
Module

x/guardenoql/deps.ts>gql

Simple and customizable security middleware for GraphQL servers in Deno.
function gql
import { gql } from "https://deno.land/x/guardenoql@v1.0.1/deps.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[]