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

Add encodeEntityId/decodeEntityId helpers #364

Merged
merged 2 commits into from
Nov 8, 2023
Merged

Add encodeEntityId/decodeEntityId helpers #364

merged 2 commits into from
Nov 8, 2023

Conversation

wKich
Copy link
Member

@wKich wKich commented Nov 6, 2023

Motivation

Sometimes users might write custom resolvers for graphql-plugin, for example they want to query backstage catalog first and then pass received entities further in a graphql query, so entities must be transformed to graphql NodeIds. It's possible to use encodeId from hydraphql for that, but it's a little overwhelming and not intuitive, because it requires some internal context of NodeId type structure.

Approach

Simplify encoding NodeIds and provide function that took Entity or EntityRef as an input and return encoded NodeId string back.

@wKich wKich requested review from cowboyd and taras November 6, 2023 15:59
Copy link

changeset-bot bot commented Nov 6, 2023

🦋 Changeset detected

Latest commit: 2c774ed

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

@frontsidejack
Copy link
Member

frontsidejack commented Nov 6, 2023

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

Generated by @thefrontside/actions Frontside

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.

It's difficult for me to review, because I don't understand how it's supposed to be used. Would you be able to update documentation to explain how to use it?

@wKich
Copy link
Member Author

wKich commented Nov 8, 2023

@taras Added

@wKich wKich requested a review from taras November 8, 2023 14:23
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.

👍

@wKich wKich merged commit e439d76 into main Nov 8, 2023
@wKich wKich deleted the dl/entity-id branch November 8, 2023 15:32
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