Group Group Group Group Group Group Group Group Group

GraphQL Using the Apollo Framework: Getting Started | raywenderlich.com

In this Apollo Framework for iOS tutorial, you will learn how to consume GraphQL APIs in a simple and type-safe way.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/10886648-graphql-using-the-apollo-framework-getting-started

Don’t know why I got this error message Error loading data networkError

Would you kindly elaborate on the problem a bit further?

That seems to be an error in FilmsViewController line 72, which might, at a glance, indicate there was perhaps problems with the connection or no connection at all.

What other information does the error provide? What was the status of your network connection at that point, and are you able to connect to the API outside of the iOS app? :slight_smile:

I am getting the following error:
→ Error initializing Apollo GraphQL project “Unnamed Project”: Error: Error in “Loading schema for Unnamed Project”: Error: Unable to read file schema.json. ENOENT: no such file or directory, open ‘schema.json’
› Error: Error initializing Apollo GraphQL project “Unnamed Project”: Error:
› Error in “Loading schema for Unnamed Project”: Error: Unable to read file
› schema.json. ENOENT: no such file or directory, open ‘schema.json’

That sounds like your schema.json file is missing. In order for your model to get generated, and do the behind-the-scenes magic, you need to have that file there and in correct formatting prior to building and running.

Have you confirmed it’s there as well as it’s location? :slight_smile:

Just FYI, you can run your queries on SWAPI single endpoint → “https://swapi-graphql.netlify.app/.netlify/functions/index

No need to run your own local or remote server.