Skip to content

enhance(stitch): validate given selection sets #280

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

Closed
wants to merge 1 commit into from

Conversation

ardatan
Copy link
Member

@ardatan ardatan commented Dec 5, 2024

Validation of required selection sets in the additional resolvers and type merging configuration

stitchSchemas({
    resolvers: {
        Book: {
            title: {
                // This resolver will throw an error if the selection set does not contain the `nonExistingFieldInBook` field
                // Stitching validates the selection set of the field resolver
                selectionSet: '{ nonExistingFieldInBook }',
                resolve() {

                }
            }
        }
    },
    merge: {
        Book: {
            // This configuration will throw an error if the selection set does not contain the `nonExistingFieldInBook` field
            // Stitching validates the selection set of the type merging configuration
            selectionSet: '{ nonExistingFieldInBook }',
            fields: {
                title: {
                    // This configuration will throw an error if the selection set does not contain the `nonExistingFieldInBook` field
                    // Stitching validates the selection set of the field configuration
                    selectionSet: '{ nonExistingFieldInBook }',
                }
            }
        }
    }
})

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-tools/federation 2.2.40-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-runtime 0.10.15-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 1.6.2-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-opentelemetry 1.3.21-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 1.3.9-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 1.3.9-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e npm ↗︎ unpkg ↗︎
@graphql-tools/stitch 9.4.9-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for macOS-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for Linux-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Bun Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:1.6.2-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e-bun

@ardatan ardatan marked this pull request as draft December 5, 2024 14:14
@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Node Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:1.6.2-alpha-f3c55e1e1e8777d9840e8336922149c786f2258e

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for macOS-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for Windows-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@ardatan ardatan closed this Jan 23, 2025
@ardatan ardatan deleted the validation-selectionset- branch January 23, 2025 16:44
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