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

Use actual graphql name on extending type #301

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

geichelberger
Copy link
Contributor

If a type is extended via a GraphQLTypeExtension annotation, the simple class name is used instead of checking whether a GraphQLName annotation is available; if the GraphQL name differs from the class name, the field cannot be fetched.

Example:

All the fields from the GqlCurrentUser class will be added with CurrentUser as the parent name. While handling the extension, the fields will be registered with GqlCurrentUser as the parent name, which does not match the actual parent.

@GraphQLName(GqlCurrentUser.TYPE_NAME)
public class GqlCurrentUser {

  public static final String TYPE_NAME = "CurrentUser";

}

@GraphQLTypeExtension(GqlCurrentUser.class)
public class EventCurrentUserExtension {
}

GraphQLFieldDefinition gqlField = graphQLFieldRetriever.getField(typeName, method, container);

vs

addExtensionField(fieldRetriever.getField(object.getSimpleName(), field, container), fields, definedFields);

If a type is extended via a GraphQLTypeExtension annotation, the simple
class name is used instead of checking whether a GraphQLName annotation
is available; if the GraphQL name differs from the class name, the field
cannot be fetched.
@geichelberger
Copy link
Contributor Author

I added a test case that fails without the patch

Copy link
Collaborator

@jkevan jkevan left a comment

Choose a reason for hiding this comment

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

Hi Geichelberger,

Thanks for your contribution! Great job on the GraphQL extensions name resolution. Merging now.

Best,
Kevan.

@jkevan jkevan merged commit 2e0f87a into Enigmatis:master Jun 10, 2024
3 checks passed
github-merge-queue bot pushed a commit to camunda/camunda that referenced this pull request Aug 5, 2024
…ns to v21.5 (main) (#20793)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[io.github.graphql-java:graphql-java-annotations](https://togithub.com/graphql-java/graphql-java-annotations)
| `21.2` -> `21.5` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.github.graphql-java:graphql-java-annotations/21.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.github.graphql-java:graphql-java-annotations/21.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.github.graphql-java:graphql-java-annotations/21.2/21.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.github.graphql-java:graphql-java-annotations/21.2/21.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>graphql-java/graphql-java-annotations
(io.github.graphql-java:graphql-java-annotations)</summary>

###
[`v21.5`](https://togithub.com/Enigmatis/graphql-java-annotations/releases/tag/v21.5)

[Compare
Source](https://togithub.com/graphql-java/graphql-java-annotations/compare/v21.2...v21.5)

#### What's Changed

- Add release documentation & update version by
[@&#8203;sergehuber](https://togithub.com/sergehuber) in
[Enigmatis/graphql-java-annotations#303
- Use actual graphql name on extending type by
[@&#8203;geichelberger](https://togithub.com/geichelberger) in
[Enigmatis/graphql-java-annotations#301
- upgrade graphql-java version to 21.5 by
[@&#8203;Janin-Michel-Mathias](https://togithub.com/Janin-Michel-Mathias)
in
[Enigmatis/graphql-java-annotations#304
- Updated secrets for publishing to maven central by
[@&#8203;Fgerthoffert](https://togithub.com/Fgerthoffert) in
[Enigmatis/graphql-java-annotations#306

#### New Contributors

-
[@&#8203;Janin-Michel-Mathias](https://togithub.com/Janin-Michel-Mathias)
made their first contribution in
[Enigmatis/graphql-java-annotations#304
- [@&#8203;Fgerthoffert](https://togithub.com/Fgerthoffert) made their
first contribution in
[Enigmatis/graphql-java-annotations#306

**Full Changelog**:
Enigmatis/graphql-java-annotations@v21.2...v21.5

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/camunda/camunda).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
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.

2 participants