I have updated my Apollo SDK version from 0.33 to latest 1.9.3. As there is a major change in the SDK, I am facing a lot of issues. I have successfully solved some but now stuck and downloading Schema using Apollo codegen CLI.
Problem Statements 1 - My Schema is stored at S3 server always. Using the CLI terminal I have created the apollo-codegen-config
and now before I call generate
command, I am trying to fetch the schema using command -
./apollo-ios-cli fetch-schema
But I am getting below error on:
Error: keyNotFound(GETCodingKeys(stringValue: "queryParameterName", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "schemaDownload", intValue: nil), CodingKeys(stringValue: "downloadMethod", intValue: nil), CodingKeys(stringValue: "introspection", intValue: nil), IntrospectionCodingKeys(stringValue: "httpMethod", intValue: nil), CodingKeys(stringValue: "GET", intValue: nil)], debugDescription: "No value associated with key GETCodingKeys(stringValue: \"queryParameterName\", intValue: nil) (\"queryParameterName\").", underlyingError: nil))
This is my apollo-codegen-config
file -
{
"schemaNamespace" : "STXAPI",
"input" : {
"operationSearchPaths" : [
"**/*.graphql"
],
"schemaSearchPaths" : [
"**/schema.json"
]
},
"output" : {
"testMocks" : {
"none" : {
}
},
"schemaTypes" : {
"path" : "./STXAPI",
"moduleType" : {
"swiftPackageManager" : {
}
}
},
"operations" : {
"inSchemaModule" : {
}
}
},
"schemaDownload": {
"downloadMethod": {
"introspection": {
"endpointURL": "https://s3.us-east-1.amazonaws.com/schema.stxapp.io/v2.0.74/schema.json",
"httpMethod": {
"GET": {}
},
"includeDeprecatedInputValues": false,
"outputFormat": "JSON"
}
},
"downloadTimeout": 60,
"headers": {
"Allow-Introspection": "true"
},
"outputPath": "./graphql/schema.graphqls"
}
}
What I am missing out or I need to change please help?
Problem Statement 2 - How can I do all the Schema Init and generate and fetch schema in a CI/CD pipeline, I am using Bitrise for that?
Any help is appreciated.