Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: TypeScriptDocumentNodesRawPluginConfig) {
super(schema, fragments, rawConfig, {
documentVariablePrefix: getConfigValue(rawConfig.namePrefix, ''),
documentVariableSuffix: getConfigValue(rawConfig.nameSuffix, ''),
fragmentVariablePrefix: getConfigValue(rawConfig.fragmentPrefix, ''),
fragmentVariableSuffix: getConfigValue(rawConfig.fragmentSuffix, ''),
});
autoBind(this);
}
}
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: ReactApolloRawPluginConfig, documents: Types.DocumentFile[]) {
super(schema, fragments, rawConfig, {
componentSuffix: getConfigValue(rawConfig.componentSuffix, 'Component'),
withHOC: getConfigValue(rawConfig.withHOC, true),
withComponent: getConfigValue(rawConfig.withComponent, true),
withHooks: getConfigValue(rawConfig.withHooks, false),
withMutationFn: getConfigValue(rawConfig.withMutationFn, true),
apolloReactCommonImportFrom: getConfigValue(rawConfig.apolloReactCommonImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-common'),
apolloReactComponentsImportFrom: getConfigValue(rawConfig.apolloReactComponentsImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-components'),
apolloReactHocImportFrom: getConfigValue(rawConfig.apolloReactHocImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-hoc'),
apolloReactHooksImportFrom: getConfigValue(rawConfig.apolloReactHooksImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-hooks'),
reactApolloVersion: getConfigValue(rawConfig.reactApolloVersion, 2),
withResultType: getConfigValue(rawConfig.withResultType, true),
withMutationOptionsType: getConfigValue(rawConfig.withMutationOptionsType, true),
addDocBlocks: getConfigValue(rawConfig.addDocBlocks, true),
});
this._externalImportPrefix = this.config.importOperationTypesFrom ? `${this.config.importOperationTypesFrom}.` : '';
this._documents = documents;
autoBind(this);
}
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: StencilApolloRawPluginConfig) {
super(schema, fragments, rawConfig, {
componentType: getConfigValue(rawConfig.componentType, StencilComponentType.functional),
noExport: rawConfig.componentType === StencilComponentType.class,
} as any);
autoBind(this);
}
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: TypeScriptDocumentNodesRawPluginConfig) {
super(schema, fragments, rawConfig, {
documentVariablePrefix: getConfigValue(rawConfig.namePrefix, ''),
documentVariableSuffix: getConfigValue(rawConfig.nameSuffix, ''),
fragmentVariablePrefix: getConfigValue(rawConfig.fragmentPrefix, ''),
fragmentVariableSuffix: getConfigValue(rawConfig.fragmentSuffix, ''),
});
autoBind(this);
}
}
constructor(private _schema: GraphQLSchema, pluginConfig: TypeScriptMongoPluginConfig) {
super(pluginConfig, ({
dbTypeSuffix: pluginConfig.dbTypeSuffix || 'DbObject',
dbInterfaceSuffix: pluginConfig.dbInterfaceSuffix || 'DbInterface',
objectIdType: resolveObjectId(pluginConfig.objectIdType).identifier,
objectIdImport: resolveObjectId(pluginConfig.objectIdType).module,
idFieldName: pluginConfig.idFieldName || '_id',
enumsAsString: getConfigValue(pluginConfig.enumsAsString, true),
avoidOptionals: getConfigValue(pluginConfig.avoidOptionals, false),
scalars: buildScalars(_schema, pluginConfig.scalars, DEFAULT_SCALARS),
} as Partial) as any);
autoBind(this);
this._variablesTransformer = new TypeScriptOperationVariablesToObject(this.scalars, this.convertName, false, false);
}
constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig: Partial = {}) {
super(schema, pluginConfig, {
noExport: getConfigValue(pluginConfig.noExport, false),
avoidOptionals: normalizeAvoidOptionals(getConfigValue(pluginConfig.avoidOptionals, false)),
maybeValue: getConfigValue(pluginConfig.maybeValue, 'T | null'),
constEnums: getConfigValue(pluginConfig.constEnums, false),
enumsAsTypes: getConfigValue(pluginConfig.enumsAsTypes, false),
immutableTypes: getConfigValue(pluginConfig.immutableTypes, false),
...(additionalConfig || {}),
} as TParsedConfig);
autoBind(this);
const enumNames = Object.values(schema.getTypeMap())
.map(type => (type instanceof GraphQLEnumType ? type.name : undefined))
.filter(t => t);
this.setArgumentsTransformer(new TypeScriptOperationVariablesToObject(this.scalars, this.convertName, this.config.avoidOptionals.object, this.config.immutableTypes, null, enumNames, pluginConfig.enumPrefix, this.config.enumValues));
this.setDeclarationBlockConfig({
enumNameValueSeparator: ' =',
ignoreExport: this.config.noExport,
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: ReactApolloRawPluginConfig, documents: Types.DocumentFile[]) {
super(schema, fragments, rawConfig, {
componentSuffix: getConfigValue(rawConfig.componentSuffix, 'Component'),
withHOC: getConfigValue(rawConfig.withHOC, true),
withComponent: getConfigValue(rawConfig.withComponent, true),
withHooks: getConfigValue(rawConfig.withHooks, false),
withMutationFn: getConfigValue(rawConfig.withMutationFn, true),
apolloReactCommonImportFrom: getConfigValue(rawConfig.apolloReactCommonImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-common'),
apolloReactComponentsImportFrom: getConfigValue(rawConfig.apolloReactComponentsImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-components'),
apolloReactHocImportFrom: getConfigValue(rawConfig.apolloReactHocImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-hoc'),
apolloReactHooksImportFrom: getConfigValue(rawConfig.apolloReactHooksImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-hooks'),
reactApolloVersion: getConfigValue(rawConfig.reactApolloVersion, 2),
withResultType: getConfigValue(rawConfig.withResultType, true),
withMutationOptionsType: getConfigValue(rawConfig.withMutationOptionsType, true),
addDocBlocks: getConfigValue(rawConfig.addDocBlocks, true),
});
this._externalImportPrefix = this.config.importOperationTypesFrom ? `${this.config.importOperationTypesFrom}.` : '';
this._documents = documents;
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: ReactApolloRawPluginConfig, documents: Types.DocumentFile[]) {
super(schema, fragments, rawConfig, {
componentSuffix: getConfigValue(rawConfig.componentSuffix, 'Component'),
withHOC: getConfigValue(rawConfig.withHOC, true),
withComponent: getConfigValue(rawConfig.withComponent, true),
withHooks: getConfigValue(rawConfig.withHooks, false),
withMutationFn: getConfigValue(rawConfig.withMutationFn, true),
apolloReactCommonImportFrom: getConfigValue(rawConfig.apolloReactCommonImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-common'),
apolloReactComponentsImportFrom: getConfigValue(rawConfig.apolloReactComponentsImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-components'),
apolloReactHocImportFrom: getConfigValue(rawConfig.apolloReactHocImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-hoc'),
apolloReactHooksImportFrom: getConfigValue(rawConfig.apolloReactHooksImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-hooks'),
reactApolloVersion: getConfigValue(rawConfig.reactApolloVersion, 2),
withResultType: getConfigValue(rawConfig.withResultType, true),
withMutationOptionsType: getConfigValue(rawConfig.withMutationOptionsType, true),
addDocBlocks: getConfigValue(rawConfig.addDocBlocks, true),
});
this._externalImportPrefix = this.config.importOperationTypesFrom ? `${this.config.importOperationTypesFrom}.` : '';
this._documents = documents;
autoBind(this);
}
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: ReactApolloRawPluginConfig, documents: Types.DocumentFile[]) {
super(schema, fragments, rawConfig, {
componentSuffix: getConfigValue(rawConfig.componentSuffix, 'Component'),
withHOC: getConfigValue(rawConfig.withHOC, true),
withComponent: getConfigValue(rawConfig.withComponent, true),
withHooks: getConfigValue(rawConfig.withHooks, false),
withMutationFn: getConfigValue(rawConfig.withMutationFn, true),
apolloReactCommonImportFrom: getConfigValue(rawConfig.apolloReactCommonImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-common'),
apolloReactComponentsImportFrom: getConfigValue(rawConfig.apolloReactComponentsImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-components'),
apolloReactHocImportFrom: getConfigValue(rawConfig.apolloReactHocImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-hoc'),
apolloReactHooksImportFrom: getConfigValue(rawConfig.apolloReactHooksImportFrom, rawConfig.reactApolloVersion === 3 ? '@apollo/client' : '@apollo/react-hooks'),
reactApolloVersion: getConfigValue(rawConfig.reactApolloVersion, 2),
withResultType: getConfigValue(rawConfig.withResultType, true),
withMutationOptionsType: getConfigValue(rawConfig.withMutationOptionsType, true),
addDocBlocks: getConfigValue(rawConfig.addDocBlocks, true),
});
this._externalImportPrefix = this.config.importOperationTypesFrom ? `${this.config.importOperationTypesFrom}.` : '';
this._documents = documents;
constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig: Partial = {}) {
super(schema, pluginConfig, {
noExport: getConfigValue(pluginConfig.noExport, false),
avoidOptionals: normalizeAvoidOptionals(getConfigValue(pluginConfig.avoidOptionals, false)),
maybeValue: getConfigValue(pluginConfig.maybeValue, 'T | null'),
constEnums: getConfigValue(pluginConfig.constEnums, false),
enumsAsTypes: getConfigValue(pluginConfig.enumsAsTypes, false),
immutableTypes: getConfigValue(pluginConfig.immutableTypes, false),
...(additionalConfig || {}),
} as TParsedConfig);
autoBind(this);
const enumNames = Object.values(schema.getTypeMap())
.map(type => (type instanceof GraphQLEnumType ? type.name : undefined))
.filter(t => t);
this.setArgumentsTransformer(new TypeScriptOperationVariablesToObject(this.scalars, this.convertName, this.config.avoidOptionals.object, this.config.immutableTypes, null, enumNames, pluginConfig.enumPrefix, this.config.enumValues));
this.setDeclarationBlockConfig({
enumNameValueSeparator: ' =',
ignoreExport: this.config.noExport,
});
}