federation icon indicating copy to clipboard operation
federation copied to clipboard

GraphQLDataSourceRequestKind should be exported

Open johgoe opened this issue 3 years ago • 3 comments

To check if GraphQLDataSourceProcessOptions is of kind INCOMING_OPERATION or of type HEALTH_CHECK or LOADING_SCHEMA the enum GraphQLDataSourceProcessOptions should be exported for other modules. Please add the export to datasource\index.ts

johgoe avatar Aug 17 '21 18:08 johgoe

I agree that would be helpful. In the meantime you can just use the string constants like 'incoming operation' yourselves, and TypeScript does a good job of raising errors if you use an invalid value.

glasser avatar Sep 09 '21 21:09 glasser

Actually looks like typescript would complain about it. image

hungcheng-houzz avatar Mar 04 '22 08:03 hungcheng-houzz

Ah you're right. @trevor-scheer we should consider either exporting it as requested here, or replacing the enum with a type X = 'a' | 'b' | 'c' thing. @brainkim has convinced me that the latter is generally better in TS.

glasser avatar Mar 04 '22 17:03 glasser