Support for returning relay encoded id when subscribing to destroy events#307
Merged
zachdaniel merged 1 commit intoash-project:mainfrom May 5, 2025
mike1o1:fix_encoded_relay_ids_on_destroy_subscriptions
Merged
Support for returning relay encoded id when subscribing to destroy events#307zachdaniel merged 1 commit intoash-project:mainfrom mike1o1:fix_encoded_relay_ids_on_destroy_subscriptions
zachdaniel merged 1 commit intoash-project:mainfrom
mike1o1:fix_encoded_relay_ids_on_destroy_subscriptions
Conversation
Contributor
|
Looks like some credo errors to fix. |
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #306
Currently, if attempting to subscribe to a destroy event, the message that is received has the shape of something like:
However, if a user has a schema with
relay_ids?: true, this is the wrong type of ID, as it doesn't get encoded as a relay id.This PR addresses that by passing the
relay_ids?value down through the domains and resources, and eventually to theresolve/2function which gets added to the Absinthe middleware. When encoding the id for a:destroyaction, therelay_ids?setting will now be respected.Tests
I couldn't find a way to change the
relay_ids?value at runtime during the test, so this unfortunately requires setting up a whole newRelaySchemaand associatedRelayDomainandRelaySubscribableresource. While verbose, this seemed like the most straight forward way to keep existing tests and schema in place.Contributor checklist