Skip to content

fix: precompute schemahash#301

Merged
danstarns merged 3 commits into
mainfrom
fix/schema-hashing
Apr 30, 2024
Merged

fix: precompute schemahash#301
danstarns merged 3 commits into
mainfrom
fix/schema-hashing

Conversation

@danstarns
Copy link
Copy Markdown
Member

@danstarns danstarns commented Apr 30, 2024

This PR exposes the schema hash when you use traceSchema so that you don't need to recompute it with each request.

const tracedScema = traceSchema({
  schema,
  adapter: // <-- See Adapters
});

const myServer = new GraphQLServerFooBar({
  schema,
  context: {
    GraphQLDebuggerContext: new GraphQLDebuggerContext({ schema: tracedSchema.schema, schemaHash: tracedSchema.schemaHash }),
  },
});

@danstarns
Copy link
Copy Markdown
Member Author

danstarns commented Apr 30, 2024

@danstarns danstarns merged commit 4024553 into main Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant