Skip to content

Implement field extensions#6856

Merged
martinbonnin merged 5 commits intomainfrom
field-extensions
Jan 27, 2026
Merged

Implement field extensions#6856
martinbonnin merged 5 commits intomainfrom
field-extensions

Conversation

@martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin requested a review from BoD as a code owner January 26, 2026 18:39
@apollo-librarian
Copy link

apollo-librarian bot commented Jan 26, 2026

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 80f2fcf3ef30d0d7d99b89e4
Build Logs: View logs

Copy link
Contributor Author

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

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

One thing to note is that I removed the possibility to change the field nullability:

type Query {
  foo: Int
}

# this is not working anymore
extend type Query {
  foo: Int! # Cannot change the type of a field
}

public static final fun validateAsExecutable (Lcom/apollographql/apollo/ast/GQLDocument;Lcom/apollographql/apollo/ast/Schema;)Lcom/apollographql/apollo/ast/ExecutableValidationResult;
public static final fun validateAsSchema (Lcom/apollographql/apollo/ast/GQLDocument;)Lcom/apollographql/apollo/ast/GQLResult;
public static final fun validateAsSchema (Lcom/apollographql/apollo/ast/GQLDocument;Lcom/apollographql/apollo/ast/internal/SchemaValidationOptions;)Lcom/apollographql/apollo/ast/GQLResult;
public static final fun validateAsSchema (Lcom/apollographql/apollo/ast/GQLDocument;Lcom/apollographql/apollo/ast/SchemaValidationOptions;)Lcom/apollographql/apollo/ast/GQLResult;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Breaking change because SchemaValidationOptions was in an internal package. It was @ApolloExperimental so I'm hoping it's not too used.

@BoD
Copy link
Contributor

BoD commented Jan 27, 2026

This doesn't include the field extensions part?

@martinbonnin
Copy link
Contributor Author

This doesn't include the field extensions part?

Can you ellaborate a bit what's missing?

@BoD
Copy link
Contributor

BoD commented Jan 27, 2026

This doesn't include the field extensions part?

Can you ellaborate a bit what's missing?

Should this implement the extend field syntax? Or it does and I'm confused?

@martinbonnin
Copy link
Contributor Author

martinbonnin commented Jan 27, 2026

Ah yes, this was discussed in the December working group and there were concerns about different lexers, etc... So the recommendation was to use the existing syntax for simplicity.

This is what @egoodwinx made in the graphql-js PR

Adding a directive is done like so:

      type Query {
        random: Int
      }      
      extend type Query {
        random: Int @deprecated
      }

I don't have a strong opinion there but not using schema coordinates, sure simplifies things

@BoD
Copy link
Contributor

BoD commented Jan 27, 2026

So the recommendation was to use the existing syntax for simplicity.

Thanks a lot for the link! I was there but missed it 😅.

Yeah I actually like that it's a smaller change 👍

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 1c54e7c into main Jan 27, 2026
7 checks passed
@martinbonnin martinbonnin deleted the field-extensions branch January 27, 2026 12:43
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