thefrontside / playhouse

Frontside's Backstage Portal
https://backstage.frontside.services/
25 stars 13 forks source link

Add `encodeEntityId/decodeEntityId` helpers #364

Closed wKich closed 1 year ago

wKich commented 1 year ago

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.

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 2c774edc3a7042485a70e4fda04ca1f0d0d6e5e4

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 commented 1 year ago

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

Generated by @thefrontside/actions Frontside

wKich commented 1 year ago

@taras Added