Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graffle helper functions #849

Closed
jasonkuhrt opened this issue May 11, 2024 · 0 comments · Fixed by #851
Closed

Graffle helper functions #849

jasonkuhrt opened this issue May 11, 2024 · 0 comments · Fixed by #851

Comments

@jasonkuhrt
Copy link
Member

Perceived Problem

  • GQLR library exposes a static import request
  • GQLR has no concept of executing against a schema
  • Graffle would do well to make migration easy

Ideas / Proposed Solution(s)

  • Add a request export
  • Add a execute export
import { execute, request, Graffle } from 'graffle'


const graffle1 = Graffle.create({
  schema: new URL('https://...'),
  headers: {...},
})

await graffle1.rawOrThrow(`GraphQL Document Here`, {
  headers: {...},
  variables: {...}
})

await request({
  schema: new URL('https://...'),
  headers: {...},
  document: `GraphQL Document Here`,
  variables: {...},
})

const graffle2 = Graffle.create({ schema: someSchema })

await graffle2.rawOrThrow(`GraphQL Document Here`)

await execute({
  schema: someSchema
  document: `GraphQL Document Here`,
  headers: {...},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant