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

Make includeDeprecated non-null #4354

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
50 changes: 35 additions & 15 deletions src/type/__tests__/introspection-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,13 @@ describe('Introspection', () => {
{
name: 'includeDeprecated',
type: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
kind: 'NON_NULL',
name: null,
ofType: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
},
},
defaultValue: 'false',
},
Expand Down Expand Up @@ -309,9 +313,13 @@ describe('Introspection', () => {
{
name: 'includeDeprecated',
type: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
kind: 'NON_NULL',
name: null,
ofType: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
},
},
defaultValue: 'false',
},
Expand All @@ -338,9 +346,13 @@ describe('Introspection', () => {
{
name: 'includeDeprecated',
type: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
kind: 'NON_NULL',
name: null,
ofType: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
},
},
defaultValue: 'false',
},
Expand Down Expand Up @@ -477,9 +489,13 @@ describe('Introspection', () => {
{
name: 'includeDeprecated',
type: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
kind: 'NON_NULL',
name: null,
ofType: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
},
},
defaultValue: 'false',
},
Expand Down Expand Up @@ -778,9 +794,13 @@ describe('Introspection', () => {
{
name: 'includeDeprecated',
type: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
kind: 'NON_NULL',
name: null,
ofType: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
},
},
defaultValue: 'false',
},
Expand Down
10 changes: 5 additions & 5 deletions src/type/introspection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const __Directive: GraphQLObjectType = new GraphQLObjectType({
),
args: {
includeDeprecated: {
type: GraphQLBoolean,
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false },
},
},
Expand Down Expand Up @@ -266,7 +266,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({
type: new GraphQLList(new GraphQLNonNull(__Field)),
args: {
includeDeprecated: {
type: GraphQLBoolean,
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false },
},
},
Expand Down Expand Up @@ -299,7 +299,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({
type: new GraphQLList(new GraphQLNonNull(__EnumValue)),
args: {
includeDeprecated: {
type: GraphQLBoolean,
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false },
},
},
Expand All @@ -316,7 +316,7 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({
type: new GraphQLList(new GraphQLNonNull(__InputValue)),
args: {
includeDeprecated: {
type: GraphQLBoolean,
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false },
},
},
Expand Down Expand Up @@ -364,7 +364,7 @@ export const __Field: GraphQLObjectType = new GraphQLObjectType({
),
args: {
includeDeprecated: {
type: GraphQLBoolean,
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false },
},
},
Expand Down
10 changes: 5 additions & 5 deletions src/utilities/__tests__/printSchema-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,11 +855,11 @@ describe('Type System Printer', () => {
name: String
description: String
specifiedByURL: String
fields(includeDeprecated: Boolean = false): [__Field!]
fields(includeDeprecated: Boolean! = false): [__Field!]
interfaces: [__Type!]
possibleTypes: [__Type!]
enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
inputFields(includeDeprecated: Boolean = false): [__InputValue!]
enumValues(includeDeprecated: Boolean! = false): [__EnumValue!]
inputFields(includeDeprecated: Boolean! = false): [__InputValue!]
ofType: __Type
isOneOf: Boolean
}
Expand Down Expand Up @@ -903,7 +903,7 @@ describe('Type System Printer', () => {
type __Field {
name: String!
description: String
args(includeDeprecated: Boolean = false): [__InputValue!]!
args(includeDeprecated: Boolean! = false): [__InputValue!]!
type: __Type!
isDeprecated: Boolean!
deprecationReason: String
Expand Down Expand Up @@ -945,7 +945,7 @@ describe('Type System Printer', () => {
description: String
isRepeatable: Boolean!
locations: [__DirectiveLocation!]!
args(includeDeprecated: Boolean = false): [__InputValue!]!
args(includeDeprecated: Boolean! = false): [__InputValue!]!
}
"""
Expand Down
Loading