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

Resolve node to null if entity doesn't exist #371

Merged
merged 2 commits into from
Dec 18, 2023
Merged

Conversation

wKich
Copy link
Member

@wKich wKich commented Dec 15, 2023

Motivation

Currently, the resolver generated by relation directive mapper doesn't check existence of entities and just returns node ids of them. This cause an error when GraphQL tries to resolve non-null field, but fails, because there is no entity returned for that id.

Approach

Added simple check to existence of entities. Because in most cases user queries additional fields of node we load an entity anyway, so it should have negative effect on performance.

@wKich wKich requested review from cowboyd and taras December 15, 2023 22:04
Copy link

changeset-bot bot commented Dec 15, 2023

🦋 Changeset detected

Latest commit: d329856

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

This PR includes changesets to release 1 package
Name Type
@frontside/backstage-plugin-graphql-backend-module-catalog 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

@taras taras left a comment

Choose a reason for hiding this comment

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

👍 that's great!

@frontsidejack
Copy link
Member

frontsidejack commented Dec 15, 2023

📣 NOTIFICATION
You are receiving this message because we did not publish any packages.

Generated by @thefrontside/actions Frontside

Signed-off-by: Dmitriy Lazarev <[email protected]>
@wKich wKich merged commit 1e119fb into main Dec 18, 2023
3 checks passed
@wKich wKich deleted the dl/relation-entity-check branch December 18, 2023 16:47
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.

3 participants