Skip to content

feat: add validationMaxErrors option#8014

Closed
mo4islona wants to merge 2 commits intoapollographql:mainfrom
mo4islona:main
Closed

feat: add validationMaxErrors option#8014
mo4islona wants to merge 2 commits intoapollographql:mainfrom
mo4islona:main

Conversation

@mo4islona
Copy link
Copy Markdown
Contributor

@mo4islona mo4islona commented Jan 8, 2025

Fixes #8013

@apollo-cla
Copy link
Copy Markdown

@mo4islona: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@svc-apollo-docs
Copy link
Copy Markdown
Collaborator

svc-apollo-docs commented Jan 8, 2025

✅ Docs Preview Ready

No new or changed pages found.

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Jan 8, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@glasser
Copy link
Copy Markdown
Member

glasser commented Jan 8, 2025

I think it would be more extensible to add a validateOptions option similar to the existing parseOptions. It's a bit awkward that graphql-js does not export a ValidationOptions TS interface, but you could use Parameters<typeof validate>[3] or something.

@mo4islona mo4islona force-pushed the main branch 2 times, most recently from 8c481ea to 380f07b Compare January 8, 2025 19:56
@mo4islona
Copy link
Copy Markdown
Contributor Author

I think it would be more extensible to add a validateOptions option similar to the existing parseOptions. It's a bit awkward that graphql-js does not export a ValidationOptions TS interface, but you could use Parameters<typeof validate>[3] or something.

Implemented.

@glasser
Copy link
Copy Markdown
Member

glasser commented Jul 3, 2025

This looks like a good improvement (very similar to #8062). It is backwards-compatible, so I'm not going to rush to get it in before releasing v5. It needs docs.

@phryneas
Copy link
Copy Markdown
Member

Seems like I can't make any changes in this PR. I'll open a new branch on this repo so I can add documentation.

@phryneas
Copy link
Copy Markdown
Member

merged via 26320bc

@phryneas phryneas closed this Jan 21, 2026
phryneas added a commit that referenced this pull request Jan 21, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @apollo/server@5.3.0

### Minor Changes

- [#8062](#8062)
[`8e54e58`](8e54e58)
Thanks [@cristunaranjo](https://github.com/cristunaranjo)! - Allow
configuration of graphql execution options (maxCoercionErrors)

    ```js
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      executionOptions: {
        maxCoercionErrors: 50,
      },
    });
    ```

-
[#8014](#8014) [`26320bc`](26320bc)
Thanks [@mo4islona](https://github.com/mo4islona)! - Expose `graphql`
validation options.

    ```js
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      validationOptions: {
        maxErrors: 10,
      },
    });
    ```

## @apollo/server-integration-testsuite@5.3.0

### Patch Changes

- Updated dependencies
\[[`8e54e58`](8e54e58),
[`26320bc`](26320bc)]:
    -   @apollo/server@5.3.0

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support validation "maxErrors" option

6 participants