Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions documentation/field-visibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ GraphqlFieldVisibility blockedFields = BlockedFields.newBlock()
.addPattern("Droid.appearsIn")
.addPattern(".*\\.hero") // it uses regular expressions
.build();
GraphQLCodeRegistry codeRegistry = GraphQLCodeRegistry.newCodeRegistry()
.fieldVisibility(blockedFields)
.build();

GraphQLSchema schema = GraphQLSchema.newSchema()
.query(StarWarsSchema.queryType)
.fieldVisibility(blockedFields)
.codeRegistry(codeRegistry)
.build();
```

Expand All @@ -31,9 +34,12 @@ There is also another implementation that prevents instrumentation from being ab
Note that this puts your server in contravention of the graphql specification and expectations of most clients so use this with caution.

```java
GraphQLCodeRegistry codeRegistry = GraphQLCodeRegistry.newCodeRegistry()
.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY)
.build();
GraphQLSchema schema = GraphQLSchema.newSchema()
.query(StarWarsSchema.queryType)
.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY)
.codeRegistry(codeRegistry)
.build();
```

Expand Down
Binary file removed static/img/graphql_creation.png
Binary file not shown.
Binary file removed static/img/playground.png
Binary file not shown.
10 changes: 8 additions & 2 deletions versioned_docs/version-v18/field-visibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ GraphqlFieldVisibility blockedFields = BlockedFields.newBlock()
.addPattern("Droid.appearsIn")
.addPattern(".*\\.hero") // it uses regular expressions
.build();
GraphQLCodeRegistry codeRegistry = GraphQLCodeRegistry.newCodeRegistry()
.fieldVisibility(blockedFields)
.build();

GraphQLSchema schema = GraphQLSchema.newSchema()
.query(StarWarsSchema.queryType)
.fieldVisibility(blockedFields)
.codeRegistry(codeRegistry)
.build();
```

Expand All @@ -31,9 +34,12 @@ There is also another implementation that prevents instrumentation from being ab
Note that this puts your server in contravention of the graphql specification and expectations of most clients so use this with caution.

```java
GraphQLCodeRegistry codeRegistry = GraphQLCodeRegistry.newCodeRegistry()
.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY)
.build();
GraphQLSchema schema = GraphQLSchema.newSchema()
.query(StarWarsSchema.queryType)
.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY)
.codeRegistry(codeRegistry)
.build();
```

Expand Down
10 changes: 8 additions & 2 deletions versioned_docs/version-v19/field-visibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ GraphqlFieldVisibility blockedFields = BlockedFields.newBlock()
.addPattern("Droid.appearsIn")
.addPattern(".*\\.hero") // it uses regular expressions
.build();
GraphQLCodeRegistry codeRegistry = GraphQLCodeRegistry.newCodeRegistry()
.fieldVisibility(blockedFields)
.build();

GraphQLSchema schema = GraphQLSchema.newSchema()
.query(StarWarsSchema.queryType)
.fieldVisibility(blockedFields)
.codeRegistry(codeRegistry)
.build();
```

Expand All @@ -31,9 +34,12 @@ There is also another implementation that prevents instrumentation from being ab
Note that this puts your server in contravention of the graphql specification and expectations of most clients so use this with caution.

```java
GraphQLCodeRegistry codeRegistry = GraphQLCodeRegistry.newCodeRegistry()
.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY)
.build();
GraphQLSchema schema = GraphQLSchema.newSchema()
.query(StarWarsSchema.queryType)
.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY)
.codeRegistry(codeRegistry)
.build();
```

Expand Down