Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

fix: handle non-null in arg parser #18

Merged
merged 1 commit into from
Oct 17, 2023
Merged

fix: handle non-null in arg parser #18

merged 1 commit into from
Oct 17, 2023

Conversation

dariuszkuc
Copy link
Member

Federated ArgumentParser is used to map entity representation to method arguments. When unwrapping nested fields, current logic was not accounting to nullability of the underlying field. If the underlying field returned non-null object, parser would fail trying to find the target property on NonNull GraphQL wrapper (which obviously doesn't exist).

Updated argument parser object handling logic to unwrap non-null types.

Note: this PR only addresses the issue with non-null types. Similar bug is present when handling keys with list representations.

Resolves: #6

Federated `ArgumentParser` is used to map entity representation to method arguments. When unwrapping nested fields, current logic was not accounting to nullability of the underlying field. If the underlying field returned non-null object, parser would fail trying to find the target property on `NonNull` GraphQL wrapper (which obviously doesn't exist).

Updated argument parser object handling logic to unwrap non-null types.

Note: this PR only addresses the issue with non-null types. Similar bug is present when handling keys with list representations.

Resolves: #6
@github-actions
Copy link

Apollo Federation Subgraph Compatibility Results

Federation 1 SupportFederation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🔲
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

@dariuszkuc dariuszkuc merged commit 2bf6ab6 into main Oct 17, 2023
2 checks passed
@dariuszkuc dariuszkuc deleted the fix_argument_parser branch October 17, 2023 05:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: map @key resolver logic fails to unwrap the entity representation
1 participant