Skip to content

Conversation

@felipe-gdr
Copy link
Member

Fixes a bug that happened when the field visibility transformation was applied to a schema that has some types reachable only via directive definitions.

Fixes a bug that happened when the field visibility transformation
was applied to a schema that has some type(s) reachable only via
directive definitions.
// Include directive definitions as roots, since they won't be removed in the filtering process.
// Some types (enums, input types, etc.) might be reachable only by directive definitions (and
// not by other types or fields).
.addAll(schema.getDirectives())
Copy link
Member

Choose a reason for hiding this comment

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

should we have schema.getAdditionalTypes here as well

Copy link
Member

Choose a reason for hiding this comment

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

I guess this ends up removing types that are no linked (if I recall right) so perhap no

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the opposite would happen: types that became unreachable after fields were filtered out would still show up in the final schema, because essentially all types would be root types and thus reachable.

@dondonz dondonz added this to the 20.0 milestone Aug 19, 2022
@bbakerman bbakerman merged commit 4652d3d into graphql-java:master Aug 22, 2022
bbakerman added a commit that referenced this pull request Sep 7, 2022
Fixes a bug that happened when the field visibility transformation
was applied to a schema that has some type(s) reachable only via
directive definitions.
bbakerman added a commit that referenced this pull request Sep 7, 2022
…) (#2944)

Fixes a bug that happened when the field visibility transformation
was applied to a schema that has some type(s) reachable only via
directive definitions.
estal011 added a commit to 8btc-OnePiece/graphql-java that referenced this pull request Jun 6, 2024
* 19.3: (709 commits)
  use class loader in getResource (graphql-java#3038)
  Stable port of graphql-java#2940 (graphql-java#2947)
  Stable port of Diff counts are the same (graphql-java#2946)
  Stable port of Fix printing directives when they contain something like a formatting specifier (graphql-java#2919) (graphql-java#2920) (graphql-java#2945)
  Stable port of Fix field visibility bug with enum with enum args (graphql-java#2926) (graphql-java#2944)
  Stable fix for graphql-java#2943 (graphql-java#2943)
  Added test fore intersection
  Xuorig Fix PR - Edge case with GraphQLTypeReference and Schema Transforms (graphql-java#2906)
  Fix typo in description of skip directive (graphql-java#2915)
  Add smaller set first optimisation
  Cheaper calculation for narrowing down possible objects in ENO
  Handles isDeprecated not being present in the json
  Defaults Locale when calling validation (graphql-java#2908)
  DF SelectionSet Benchmark (graphql-java#2893)
  Test stability (graphql-java#2903)
  Donna's catch! (graphql-java#2900)
  Deprecate Apollo Cache Control
  READY - Stop DOS attacks by making the lexer stop early on evil input. (graphql-java#2892)
  Bump java-dataloader ahead of release
  State is passed explicitly to instrumentation and parameters are NOT mutated (graphql-java#2769)
  ...

# Conflicts:
#	README.md
#	build.gradle
#	src/main/java/graphql/GraphQL.java
#	src/main/java/graphql/Scalars.java
#	src/main/java/graphql/execution/ValuesResolver.java
#	src/main/java/graphql/relay/SimpleListConnection.java
#	src/main/java/graphql/schema/DataFetchingEnvironmentImpl.java
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