ApolloCodegenConfiguration.FileInput
STRUCT
ApolloCodegenConfiguration.FileInput
1public struct FileInput: Codable, EquatableThe input paths and files required for code generation.
Properties
schemaSearchPaths
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.graphqlPrecondition: 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
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:
Operation Definitions (ie.
query,mutation, orsubscription)
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:)
1public init(
2 schemaSearchPaths: [String] = ["**/*.graphqls"],
3 operationSearchPaths: [String] = ["**/*.graphql"]
4)Designated initializer.
Parameters:
schemaSearchPaths: 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
TypeSystemDocumentorTypeSystemExtensiondefinitions in SDL or JSON format. This includes:Defaults to
["**/*.graphqls"].operationSearchPaths: 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
ExecutableDocumentdefinitions in SDL format. This includes:Operation Definitions (ie.
query,mutation, orsubscription)
Defaults to
["**/*.graphql"].
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.graphqlPrecondition: 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
| Name | Description |
|---|---|
| schemaSearchPaths | 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 or definitions in SDL or JSON format. This includes: Defaults to ["**/*.graphqls"]. |
| operationSearchPaths | 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 definitions in SDL format. This includes: Defaults to ["**/*.graphql"]. |
init(schemaPath:operationSearchPaths:)
1public init(
2 schemaPath: String,
3 operationSearchPaths: [String] = ["**/*.graphql"]
4)Convenience initializer.
Parameters:
schemaPath: The path to a local GraphQL schema file to be used for code generation. Schema files may contain only spec-compliant
TypeSystemDocumentorTypeSystemExtensiondefinitions in SDL or JSON format. This includes:operationSearchPaths: 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
ExecutableDocumentdefinitions in SDL format. This includes:Operation Definitions (ie.
query,mutation, orsubscription)
Defaults to
["**/*.graphql"].
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.graphqlPrecondition: 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
| Name | Description |
|---|---|
| schemaPath | The 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: |
| operationSearchPaths | 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 definitions in SDL format. This includes: Defaults to ["**/*.graphql"]. |