Unable to perform Code Generation with SPM on iOS

Hi Guys.

I am having an issue running the Code Generation on SPM for iOS, for proper context, I am building an SPM library that will be using Apollo to make Network calls internally.

I have followed the steps in the documentation however when i attempt to run code generation, I encounter this error.

This is the content of my ExampleQuery.graphql file

query Query { company { ceo } roadster { apoapsis_au } }

The content of my apollo-codegen-config file

{ "schemaName" : "SchemaPackage", "input" : { "operationSearchPaths" : [ "./*.graphql" ], "schemaSearchPaths" : [ "./*.graphqls" ] }, "output" : { "testMocks" : { "none" : { } }, "schemaTypes" : { "path" : "./SchemaPackage", "moduleType" : { "swiftPackageManager" : { } } }, "operations" : { "relative" : { } } }, "schemaDownloadConfiguration": { "downloadMethod": { "introspection": { "endpointURL": "https://api.spacex.land/graphql/", "httpMethod": { "POST": {} }, "includeDeprecatedInputValues": false, "outputFormat": "SDL" } }, "downloadTimeout": 60, "headers": [], "outputPath": "./graphqls/" } }

Apologies for the formatting, couldn’t upload them as picture cos new users can post more than one image

apollo-ios SDK version: 1.0.0
Xcode version: 14.0
iOS Version: 13
swift-tools-version: 5.6

The GraphQL compiler is telling you there is an issue with your operation definition fetching that company field.

This is possibly an issue with your schema. Is your schema being picked up with the
"schemaSearchPaths" : [ "./*.graphqls" ]? If your schema is a JSON schema it might have the json extension.

If so, is the company field on your root Query type and is its return type another GraphQL object type?

Hi,

I don’t know if we have the same problem https://community.apollographql.com/t/error-cannot-query-field-apollo-ios-cliente-code-generation/4739?u=david