Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
seed: null,
// fail after the first error
fail_fast: true,
},
/* istanbul ignore next : to hard to test, also no reason to test for it */
options || {},
)
this.config = new Config(this.settings)
// this loads all the config files/plugins
this._loadConfigs()
// auto binds methods to it's instance
autoBind(this)
}
constructor(config: ClientConfig) {
super(config);
// @ts-ignore
autoBind(this);
}
enumPrefix: getConfigValue(rawConfig.enumPrefix, true),
federation: getConfigValue(rawConfig.federation, false),
resolverTypeWrapperSignature: getConfigValue(rawConfig.resolverTypeWrapperSignature, 'Promise | T'),
enumValues: parseEnumValues(_schema, rawConfig.enumValues),
addUnderscoreToArgsType: getConfigValue(rawConfig.addUnderscoreToArgsType, false),
contextType: parseMapper(rawConfig.contextType || 'any', 'ContextType'),
fieldContextTypes: getConfigValue(rawConfig.fieldContextTypes, []),
rootValueType: parseMapper(rawConfig.rootValueType || '{}', 'RootValueType'),
avoidOptionals: getConfigValue(rawConfig.avoidOptionals, false),
defaultMapper: rawConfig.defaultMapper ? parseMapper(rawConfig.defaultMapper || 'any', 'DefaultMapperType') : null,
mappers: transformMappers(rawConfig.mappers || {}),
scalars: buildScalars(_schema, rawConfig.scalars, defaultScalars),
...(additionalConfig || {}),
} as TPluginConfig);
autoBind(this);
this._federation = new ApolloFederation({ enabled: this.config.federation, schema: this.schema });
this._rootTypeNames = getRootTypeNames(_schema);
this._variablesTransfomer = new OperationVariablesToObject(this.scalars, this.convertName);
this._resolversTypes = this.createResolversFields(type => this.applyResolverTypeWrapper(type), type => this.clearResolverTypeWrapper(type), name => this.getTypeToUse(name));
this._resolversParentTypes = this.createResolversFields(type => type, type => type, name => this.getParentTypeToUse(name));
this._fieldContextTypeMap = this.createFieldContextTypeMap();
}
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(params) {
super(params);
autoBind(this);
}
constructor(schema: GraphQLSchema, pluginConfig: FlowPluginConfig) {
super(schema, pluginConfig, {
useFlowExactObjects: getConfigValue(pluginConfig.useFlowExactObjects, true),
useFlowReadOnlyTypes: getConfigValue(pluginConfig.useFlowReadOnlyTypes, false),
} as FlowPluginParsedConfig);
autoBind(this);
const enumNames = Object.values(schema.getTypeMap())
.map(type => (type instanceof GraphQLEnumType ? type.name : undefined))
.filter(t => t);
this.setArgumentsTransformer(new FlowOperationVariablesToObject(this.scalars, this.convertName, null, enumNames, pluginConfig.enumPrefix));
this.setDeclarationBlockConfig({
blockWrapper: this.config.useFlowExactObjects ? '|' : '',
});
}
constructor(params) {
this.tabId = params.tabId;
this.containerId = params.containerId;
this.show = params.show;
this.flip = params.flip;
this.forceOuterCardResize = params.forceCardResize;
this.health = ko.observable(new Health());
this.massiveDamageTaken = ko.observable(false);
this.deathSavesVisible = ko.observable(false);
this.subscriptions = [];
autoBind(this);
}
constructor(schema: GraphQLSchema, config: TypeScriptDocumentsPluginConfig, allFragments: LoadedFragment[]) {
super(
config,
{
noExport: getConfigValue(config.noExport, false),
avoidOptionals: typeof config.avoidOptionals === 'boolean' ? getConfigValue(config.avoidOptionals, false) : false,
immutableTypes: getConfigValue(config.immutableTypes, false),
nonOptionalTypename: getConfigValue(config.nonOptionalTypename, false),
} as TypeScriptDocumentsParsedConfig,
schema
);
autoBind(this);
const clearOptional = (str: string): string => {
const prefix = this.config.namespacedImportName ? `${this.config.namespacedImportName}\.` : '';
const rgx = new RegExp(`^${prefix}Maybe<(.*?)>$`, 'is');
if (str.startsWith(`${this.config.namespacedImportName ? `${this.config.namespacedImportName}.` : ''}Maybe`)) {
return str.replace(rgx, '$1');
}
return str;
};
const wrapTypeWithModifiers = (baseType: string, type: GraphQLObjectType | GraphQLNonNull | GraphQLList): string => {
const prefix = this.config.namespacedImportName ? `${this.config.namespacedImportName}.` : '';
if (isNonNullType(type)) {
constructor(params) {
super(params);
this.addFormId = '#add-spell';
this.collapseAllId = '#spells-pane';
this.filteredByCastable = ko.observable(false);
this.spellStats = ko.observable(new SpellStats());
this.spellSlots = ko.observableArray([]);
autoBind(this);
}
constructor(private _schema: Schema = {}) {
autoBind(this);
}