Skip to content

@stonecrop/graphql-middleware graphqlExecute #383

@asmgit

Description

@asmgit

What I should use for graphqlExecute?

https://github.com/agritheory/stonecrop/tree/development/graphql_middleware

import { createServer } from 'postgraphile/grafserv/h3/v1'
import { grafserv } from 'postgraphile/grafserv'
import { PostGraphileAmberPreset } from 'postgraphile/presets/amber'
import { makePgService } from 'postgraphile/adaptors/pg'
import {
  createStonecropPlugin,
  loadDoctypes,
  registerBuiltinHandlers,
  registerHandler,
} from '@stonecrop/graphql-middleware'

...
// Create executor for the plugin to use
const executor = {
  async query(query: string, variables?: Record<string, unknown>) {
    // Execute against PostGraphile's internal schema
    return graphqlExecute(schema, query, variables)
  },
  async mutate(mutation: string, variables?: Record<string, unknown>) {
    return this.query(mutation, variables)
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions