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

🧪 @experimental support #4091

Merged
merged 8 commits into from
May 10, 2022
Merged

🧪 @experimental support #4091

merged 8 commits into from
May 10, 2022

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented May 10, 2022

Add support for the @experimental directive. By default, it annotates experimental fields, input fields and enum values with com.apollographql.apollo3.annotations.Experimental. This can be changed with a Gradle setting:

apollo {
  experimentalAnnotation.set("com.example.MyOptInAnnotation")
  // "none" is a special value that will not emit any annotation
  experimentalAnnotation.set("none")
}

@martinbonnin martinbonnin requested review from sav007 and BoD as code owners May 10, 2022 07:27
@netlify
Copy link

netlify bot commented May 10, 2022

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 52894d1
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/627a5dc98272430007437bfd

dependencies:
mime-types "~2.1.34"
negotiator "0.6.3"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea why this was added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And it was just removed 🤔 .... My current guess is that it depends if it's the root project or the tests project that is run last.... But that'd be a bit scary TBH

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My current guess is that it depends if it's the root project or the tests project that is run last

confirmed. I'll make a follow up PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

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

Very cool!

apollo-ast/src/main/resources/apollo.graphqls Show resolved Hide resolved
* - AnnotationTarget.PROPERTY
* - AnnotationTarget.CLASS
*
* Default: "com.apollographql.apollo3.annotations.ApolloExperimental"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% convinced we should re-use ApolloExperimental for the default as it is currently kind of specific to the project's codebase, so maybe it would be worth it to introduce a specific Experimental annotation.
Not a big deal for the time being!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed the semantics are different but didn't find a good alternative name. GraphQLExperimental maybe ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking just Experimental but I like GraphQLExperimental too. Another idea: SchemaExperimental.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was a bit concerned Experimental would clash with other annotation but maybe it's not the case. Maybe we should make @Experimental @ApolloExperimental 🙃 .

Just kidding. I'll go with @Experimental and we'll see how that unfolds.

@martinbonnin martinbonnin merged commit a20964c into main May 10, 2022
@martinbonnin martinbonnin deleted the experimental branch May 10, 2022 14:54
martinbonnin added a commit that referenced this pull request May 11, 2022
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