xCode: Execution failed with a nonzero exit code

Could someone please help me resolve this error? Is kind of frustrating at this point, Apollo SDK should work out of the box right? running latest Xcode version and Apollo 0.50.0

Showing Recent Issues
Loading Apollo Project [failed]

→ Error initializing Apollo GraphQL project “Unnamed Project”: Error: Error in “Loading schema for Unnamed Project”: Error: Invalid or incomplete introspection result. Ensure that you are passing “data” property of introspection response and no “errors” was returned alongside: { __schema: undefined }.

› Error: Error initializing Apollo GraphQL project “Unnamed Project”: Error:
› Error in “Loading schema for Unnamed Project”: Error: Invalid or
› incomplete introspection result. Ensure that you are passing “data”
› property of introspection response and no “errors” was returned alongside:
› { __schema: undefined }.

Hi :wave: - this looks like an error from graphql-js which apollo-ios uses internally for schema validation and parsing.

The gist of the error is that JSON from the introspection result cannot be parsed correctly. How are you initiating the call that results in this error? Do you mind sharing the ApolloSchemaDownloadConfiguration that you’re using - please redact anything that is sensitive before sharing though.

Hi, thxs for your quick reply. I’m struggling here and there with the terminology, novice things :wink: But i don’t know what you mean by ApolloSchemaDownloadConfiguration and where i can find it. I’m using WPGraphQL and i’m assuming this the schema:

query MyQuery {
  categories {
    edges {
      node {
        name
      }
    }
  }
}

And it returns the JSON:

{
  "data": {
    "categories": {
      "edges": [
        {
          "node": {
            "name": "Fruits"
          }
        }
      ]
    }
  }
}

And in Xcode, i use the SDK and the build step script.

Ok I manage to get it to work. I realize that I was confused what the schema really was. I got it downloaded and now build with no errors. :raised_hands: :raised_hands:

thxs :v:t4:

That’s great, glad you could figure it out. Happy to help!

1 Like