Skip to content
Merged
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
18 changes: 18 additions & 0 deletions src/utilities/__tests__/buildClientSchema-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,24 @@ describe('Type System: build schema from introspection', () => {
);
});

it('throws when missing definition for one of the standard scalars', () => {
const schema = buildSchema(`
type Query {
foo: Float
}
`);
const introspection = introspectionFromSchema(schema);

// $DisableFlowOnNegativeTest
introspection.__schema.types = introspection.__schema.types.filter(
({ name }) => name !== 'Float',
);

expect(() => buildClientSchema(introspection)).to.throw(
'Invalid or incomplete schema, unknown type: Float. Ensure that a full introspection query is used in order to build a client schema.',
);
});

it('throws when type reference is missing name', () => {
const introspection = introspectionFromSchema(dummySchema);

Expand Down