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

Expose the built in rules when using it programmatically #2787

Open
ThomasJamesCrawford opened this issue Jun 13, 2024 · 0 comments
Open

Expose the built in rules when using it programmatically #2787

ThomasJamesCrawford opened this issue Jun 13, 2024 · 0 comments

Comments

@ThomasJamesCrawford
Copy link

Is your feature request related to a problem? Please describe.

We want to import and use this tool within another js tool, but it seems like the built in rules (e.g. dangerousBreaking, suppressRemovalOfDeprecatedField, ignoreDescriptionChanges, safeUnreachable) aren't exposed even though they're included in @graphql-inspector/core

e.g. we use it like this
import { diff } from "@graphql-inspector/core";

Describe the solution you'd like

Some way to import the pre-made rules

import { diff, rules } from "@graphql-inspector/core";

await diff(schema, schema2, [rules.dangerousBreaking]);

Describe alternatives you've considered

Just copy pasting out the rules

Using the CLI

Additional context

We want to be able to narrow down the set of changes we consider breaking more specifically to allow some to pass, which is why we use it programmatically.

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

No branches or pull requests

1 participant