ApolloCodegenConfiguration.FileInput


STRUCT

ApolloCodegenConfiguration.FileInput

Swift
1public struct FileInput: Codable, Equatable

The input paths and files required for code generation.

Properties

schemaSearchPaths

Swift
1public let schemaSearchPaths: [String]

An array of path matching pattern strings used to find GraphQL schema files to be included for code generation.

Schema files may contain only spec-compliant TypeSystemDocument or TypeSystemExtension definitions in SDL or JSON format. This includes:

You can use absolute or relative paths in path matching patterns. Relative paths will be based off the current working directory from FileManager.

Each path matching pattern can include the following characters:

  • * matches everything but the directory separator (shallow), eg: *.graphql

  • ? matches any single character, eg: file-?.graphql

  • ** matches all subdirectories (deep), eg: **/*.graphql

  • ! excludes any match only if the pattern starts with a ! character, eg: !file.graphql

  • Precondition: JSON format schema files must have the file extension ".json". When using a JSON format schema file, only a single JSON schema can be provided with any number of additional SDL schema extension files.

operationSearchPaths

Swift
1public let operationSearchPaths: [String]

An array of path matching pattern strings used to find GraphQL operation files to be included for code generation.

Operation files may contain only spec-compliant ExecutableDocument definitions in SDL format. This includes:

You can use absolute or relative paths in path matching patterns. Relative paths will be based off the current working directory from FileManager.

Each path matching pattern can include the following characters:

  • * matches everything but the directory separator (shallow), eg: *.graphql

  • ? matches any single character, eg: file-?.graphql

  • ** matches all subdirectories (deep), eg: **/*.graphql

  • ! excludes any match only if the pattern starts with a ! character, eg: !file.graphql

Methods

init(schemaSearchPaths:operationSearchPaths:)

Swift
1public init(
2  schemaSearchPaths: [String] = ["**/*.graphqls"],
3  operationSearchPaths: [String] = ["**/*.graphql"]
4)

Designated initializer.

You can use absolute or relative paths in path matching patterns. Relative paths will be based off the current working directory from FileManager.

Each path matching pattern can include the following characters:

  • * matches everything but the directory separator (shallow), eg: *.graphql

  • ? matches any single character, eg: file-?.graphql

  • ** matches all subdirectories (deep), eg: **/*.graphql

  • ! excludes any match only if the pattern starts with a ! character, eg: !file.graphql

  • Precondition: JSON format schema files must have the file extension ".json". When using a JSON format schema file, only a single JSON schema can be provided with any number of additional SDL schema extension files.

Parameters

NameDescription
schemaSearchPathsAn array of path matching pattern strings used to find GraphQL schema files to be included for code generation. Schema files may contain only spec-compliant or definitions in SDL or JSON format. This includes: Defaults to ["**/*.graphqls"].
operationSearchPathsAn array of path matching pattern strings used to find GraphQL operation files to be included for code generation. Operation files may contain only spec-compliant definitions in SDL format. This includes: Defaults to ["**/*.graphql"].

init(schemaPath:operationSearchPaths:)

Swift
1public init(
2  schemaPath: String,
3  operationSearchPaths: [String] = ["**/*.graphql"]
4)

Convenience initializer.

You can use absolute or relative paths in path matching patterns. Relative paths will be based off the current working directory from FileManager.

Each path matching pattern can include the following characters:

  • * matches everything but the directory separator (shallow), eg: *.graphql

  • ? matches any single character, eg: file-?.graphql

  • ** matches all subdirectories (deep), eg: **/*.graphql

  • ! excludes any match only if the pattern starts with a ! character, eg: !file.graphql

  • Precondition: JSON format schema files must have the file extension ".json". When using a JSON format schema file, only a single JSON schema can be provided with any number of additional SDL schema extension files.

Parameters

NameDescription
schemaPathThe path to a local GraphQL schema file to be used for code generation. Schema files may contain only spec-compliant or definitions in SDL or JSON format. This includes:
operationSearchPathsAn array of path matching pattern strings used to find GraphQL operation files to be included for code generation. Operation files may contain only spec-compliant definitions in SDL format. This includes: Defaults to ["**/*.graphql"].
Feedback

Edit on GitHub

Forums