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

GraphQL Schema Error Warnings #22535

Merged
merged 14 commits into from
May 28, 2024
Merged

GraphQL Schema Error Warnings #22535

merged 14 commits into from
May 28, 2024

Conversation

br41nslug
Copy link
Member

@br41nslug br41nslug commented May 21, 2024

Fixes #19448
Fixes #20928
Fixes #22520
Fixes #22581

Scope

What's changed:

  • Adds integrity checks to GraphQL schema generation
  1. Checks for invalid collection names in the schema skips them and throws a warning
  2. Checks for reserved keywords in collections names skips them and throws a warning
  3. Checks relations for links to skipped or non-existent collections

Potential Risks / Drawbacks

  • Some queries may not work because of the sanitization, however if you have any of these names in your schema currently then no graphql queries will work at all since it crashes on schema generation.
  • There is a risk of sanitizing too strictly removing things that should work!

Review Notes / Questions

  • I would like to lorem ipsum
  • Any suggestions to improve testing around this?

Copy link

changeset-bot bot commented May 21, 2024

🦋 Changeset detected

Latest commit: 3887d5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@paescuj paescuj left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@paescuj paescuj merged commit 45b0587 into main May 28, 2024
4 checks passed
@paescuj paescuj deleted the fix-20928 branch May 28, 2024 14:12
@github-actions github-actions bot added this to the Next Release milestone May 28, 2024
rijkvanzanten added a commit that referenced this pull request May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment