Skip to content

Commit

Permalink
add failing test for #2895
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgovea committed Apr 21, 2021
1 parent 1611bbb commit bb76a16
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/type/__tests__/introspection-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'chai';
import { assert, expect } from 'chai';
import { describe, it } from 'mocha';

import invariant from '../../jsutils/invariant';
Expand Down Expand Up @@ -1586,4 +1586,25 @@ describe('Introspection', () => {
}),
).to.not.throw();
});

it('can include deprecated input fields', () => {
const schema = buildSchema(`
type Query {
oldField(input: Boolean @deprecated(reason: "got over it")): String
}
`);

const source = getIntrospectionQuery({
inputValueDeprecation: true,
});

const { data, errors } = graphqlSync({
schema,
source,
});

assert.isUndefined(errors, `Introspection query was not successful ${JSON.stringify(errors)}`);
assert.isOk(data);
});

});

0 comments on commit bb76a16

Please sign in to comment.