Skip to content

Commit

Permalink
Revert "fix(preset/near-operation-file): accept skipDocumentsValidati…
Browse files Browse the repository at this point in the history
…on config parameter. Closes #214 (#383)"

This reverts commit 9a692da.
  • Loading branch information
saihaj authored Sep 25, 2023
1 parent 2187780 commit d9b55f1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 55 deletions.
12 changes: 0 additions & 12 deletions .changeset/thirty-books-explode.md

This file was deleted.

5 changes: 1 addition & 4 deletions packages/presets/near-operation-file/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,7 @@ export const preset: Types.OutputPreset<NearOperationFileConfig> = {
config,
schema: options.schema,
schemaAst: schemaObject,
skipDocumentsValidation:
typeof options.skipDocumentsValidation === 'undefined'
? { skipDuplicateValidation: true }
: options.skipDocumentsValidation,
skipDocumentsValidation: true,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,45 +699,7 @@ describe('near-operation-file preset', () => {
pluginMap: {},
});

expect(result[0].skipDocumentsValidation).toEqual({ skipDuplicateValidation: true });
});

it('Should allow to customize the skip documents validation', async () => {
const result = await executePreset({
baseOutputDir: './src/',
config: {},
presetConfig: {
baseTypesPath: 'types.ts',
},
schema: schemaDocumentNode,
schemaAst: schemaNode,
documents: testDocuments,
plugins: [],
pluginMap: {},
skipDocumentsValidation: {
skipValidationAgainstSchema: true,
},
});

expect(result[0].skipDocumentsValidation).toEqual({ skipValidationAgainstSchema: true });
});

it('Should allow to opt-out skipping documents validation', async () => {
const result = await executePreset({
baseOutputDir: './src/',
config: {},
presetConfig: {
baseTypesPath: 'types.ts',
},
schema: schemaDocumentNode,
schemaAst: schemaNode,
documents: testDocuments,
plugins: [],
pluginMap: {},
skipDocumentsValidation: false,
});

expect(result[0].skipDocumentsValidation).toBe(false);
expect(result[0].skipDocumentsValidation).toBeTruthy();
});

it('Should allow to customize output extension', async () => {
Expand Down

0 comments on commit d9b55f1

Please sign in to comment.