Skip to content

Conversation

@pavelnikolov
Copy link
Member

Allow cloning of a schema with a new resolver. Also allow applying a resolver to a schema without one.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the ability to clone a GraphQL schema with a new resolver and apply a resolver to a schema that was created without one. These features enable multi-tenant scenarios and deferred resolver binding patterns.

Changes:

  • Added Clone and MustClone methods to create schema copies with different resolvers and options
  • Added ApplyResolver method to attach a resolver to a nil-resolver schema (can only be called once)
  • Added sync.Mutex to the Schema struct for thread-safe resolver application
  • Added comprehensive test coverage for cloning, resolver application, concurrency, and multi-tenant scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
graphql.go Implements Clone, MustClone, and ApplyResolver methods with mutex for concurrency safety
graphql_test.go Adds extensive tests for schema cloning, resolver application, concurrency, and multi-tenant use cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pavelnikolov pavelnikolov force-pushed the 001-schema-clone-resolver branch from 9cece25 to fff7573 Compare January 15, 2026 08:19
@pavelnikolov pavelnikolov force-pushed the 001-schema-clone-resolver branch from fff7573 to 261b6c8 Compare January 15, 2026 08:35
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.

2 participants