Apollo iOS 1.
0
• Create an Xcode project.
• Add GraphQL schema that we’ll be work on. It might be in .json or .graphqls format.
• Create the queries that we’ll be using in a .graphql le.
• Create the pod le to install Apollo pod init.
• Add the Apollo pod pod ‘Apollo’.
• Install the dependencies pod install.
• In Pods/Apollo will be installed the Apollo cli that will be used to create the code required
from Apollo to work in our project apollo-ios-cli.
• Execute the next command in the root project directory to create a json le for the code
generation settings.
• The previous command must create a le called apollo-codegen-con [Link] in the root
directory. We can edit the “schemaSearchPaths” parameter to work with .json schemas.
• Once the settings le is ok, run the next command to generate the code for our project and
that’s all!
fi
fi
fi
fi
fi
fi
Apollo iOS 0.x (legacy)
• Create an Xcode project.
• Add GraphQL schema that we’ll be work on. It might be in .json or .graphqls format.
• Create the queries that we’ll be using in a .graphql le.
• Create the pod le to install Apollo pod init.
• Add the Apollo pod pod 'Apollo', '~> 0.17.0', :inhibit_warnings => true.
• Install the dependencies pod install.
• To tell Apollo to perform the code generation, we need to add a new build phase in Xcode
and write the next script. We need to specify the target name and the name of the schema.
• Once we build the project, a new le called “[Link]” with all the needed code will be
generated!
fi
fi
fi