node_modules.apollo-codegen.src.__tests__.introspectSchema.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apollo-client-maven-plugin Show documentation
Show all versions of apollo-client-maven-plugin Show documentation
Maven plugin for generating graphql clients
import { readFileSync } from 'fs';
import { join } from 'path';
import { introspect } from '../introspectSchema';
describe('Introspecting GraphQL schema documents', () => {
test(`should generate valid introspection JSON file`, async () => {
const schemaContents = readFileSync(join(__dirname, '../../../common-test/fixtures/starwars/schema.graphql')).toString();
const expected = readFileSync(join(__dirname, '../../../common-test/fixtures/starwars/schema.json')).toString();
const schema = await introspect(schemaContents);
expect(JSON.stringify(schema, null, 2)).toEqual(expected);
});
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy