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

[compiler] Add support for @catch on fieldDefinitions, interfaces and objects #5623

Merged
merged 4 commits into from
Feb 20, 2024

Conversation

martinbonnin
Copy link
Contributor

Implementation of apollographql/specs#48
See apollographql/specs#47

@catch can now be set, by order or precedence:

At the schema level

// All fields are modeled as FieldResult in Kotlin
extend schema @catch(to: RESULT)

At the field definition level

type User {
  // email is modeled as FieldResult in Kotlin
  email @catch(to: RESULT)
}

// or if you don't own the schema
extend type User @catchField(name: "email", to: RESULT)

At the field level

query GetEmail {
  user {
    // email is modeled as FieldResult in Kotlin for this query only
    email @catch(to: RESULT)
  }
}

Also took this opportunity to factor in the @semanticNonNullField handling in schema merging so that it's done in a central place.

Copy link

netlify bot commented Feb 14, 2024

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit d8b4b4c
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/65cc859f12ebe90008fc3095

@martinbonnin martinbonnin marked this pull request as ready for review February 14, 2024 09:00
Comment on lines +70 to +71
<option name="CALL_PARAMETERS_WRAP" value="0" />
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="false" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why we need this now. I'm attributing this to latest EAP but something to keep an eye on

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.

👍

@martinbonnin martinbonnin merged commit f301e9b into main Feb 20, 2024
9 checks passed
@martinbonnin martinbonnin deleted the catch-coordinates branch February 20, 2024 15:09
@martinbonnin
Copy link
Contributor Author

Ping @rohandhruva . If everything goes well, this should end up in the SNAPSHOTs soon.

@rohandhruva
Copy link
Contributor

Thank you so much, I'll keep an eye out for it!

martinbonnin added a commit that referenced this pull request Feb 27, 2024
… objects (#5623)

* add support for @catch on fieldDefinitions, interfaces&objects

* fix indentation

* fix indentation

* fix indentation
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.

3 participants