Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const languagePlugin = getLanguagePlugin((relayConfig && relayConfig.language) || "javascript")
const directivesFile = generateDirectivesFile()
const includesGlobPattern = (inputExtensions: string[]) => `**/*.{graphql,${inputExtensions.join(",")}}`
const config: ApolloConfigFormat = {
client: {
service: {
name: "local",
localSchemaFile: relayConfig ? relayConfig.schema : DEFAULTS.localSchemaFile,
},
validationRules: [
RelayKnownArgumentNames,
RelayKnownVariableNames,
RelayVariablesInAllowedPosition,
RelayArgumentsOfCorrectType,
...defaultValidationRules.filter(
(rule: ValidationRule) => !ValidationRulesToExcludeForRelay.includes(rule.name)
),
],
includes: [
directivesFile,
path.join((relayConfig || DEFAULTS).src, includesGlobPattern(languagePlugin.inputExtensions)),
],
excludes: relayConfig ? relayConfig.exclude : [],
tagName: "graphql",
},
}
return { config, directivesFile, includesGlobPattern }
}