From a4bb046bb70d7dbc78265e742ec94e0e3e983034 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 5 Apr 2024 15:59:44 +0200 Subject: [PATCH] Fix stream directive validation error message --- .../DeferStreamDirectiveOnValidOperationsRule-test.ts | 6 +++--- .../rules/DeferStreamDirectiveOnValidOperationsRule.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/validation/__tests__/DeferStreamDirectiveOnValidOperationsRule-test.ts b/src/validation/__tests__/DeferStreamDirectiveOnValidOperationsRule-test.ts index 3dee7fe5a1..ab2488ff28 100644 --- a/src/validation/__tests__/DeferStreamDirectiveOnValidOperationsRule-test.ts +++ b/src/validation/__tests__/DeferStreamDirectiveOnValidOperationsRule-test.ts @@ -241,7 +241,7 @@ describe('Validate: Defer/Stream directive on valid operations', () => { `).toDeepEqual([ { message: - 'Stream directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.', + 'Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.', locations: [{ line: 4, column: 20 }], }, ]); @@ -259,7 +259,7 @@ describe('Validate: Defer/Stream directive on valid operations', () => { `).toDeepEqual([ { message: - 'Stream directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.', + 'Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.', locations: [{ line: 8, column: 18 }], }, ]); @@ -301,7 +301,7 @@ describe('Validate: Defer/Stream directive on valid operations', () => { `).toDeepEqual([ { message: - 'Stream directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.', + 'Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.', locations: [{ line: 15, column: 18 }], }, ]); diff --git a/src/validation/rules/DeferStreamDirectiveOnValidOperationsRule.ts b/src/validation/rules/DeferStreamDirectiveOnValidOperationsRule.ts index e8e6a292b6..44a15009b2 100644 --- a/src/validation/rules/DeferStreamDirectiveOnValidOperationsRule.ts +++ b/src/validation/rules/DeferStreamDirectiveOnValidOperationsRule.ts @@ -70,7 +70,7 @@ export function DeferStreamDirectiveOnValidOperationsRule( if (!ifArgumentCanBeFalse(node)) { context.reportError( new GraphQLError( - 'Stream directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.', + 'Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.', { nodes: node }, ), );