Adding GraphQL Schema file in Xcode project.

Chandan
2 min readJan 23, 2022

I want to go index page of this tutorial series.

Hey, Most important thing. →

  1. If home-brew is not installed in your Mac then please go and install Home-brew. → Home-brew website

other wise you can run this command in terminal

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

And enter your mac password then press enter. boom Installation will progress it will take 20 minutes maybe 🤔.

Example → 👇

home brew installation image
home brew installation

2. And Also install Apollo-cli

Just run the command in your terminal % brew install apollo-cli. 👇

install apollo cli

* Adding Schema file.

So first we download our schema file from our beautiful terminal.

  • For downloading the schema follow the steps.
  1. Open your new fresh beautiful terminal.
  2. Run the command % cd Desktop & hit enter → you. are on Desktop.
  3. For downloading schema file run this command →

apollo schema:download --endpoint=YOUR END POINT schema.json

For Example → 👇

Example of downloading schema file

Your schema has been downloaded, you can find it on your desktop. 😎

To adding your project file simple Just drag and drop in your Xcode project hierarchy simple.

And then select this options 👇 and then click finish.

Here's your schema file is successfully added. Cheers 🍻 🥂 🍺

_______________

NOTE →

Our Xcode don't accept old json file (Json Schema File),

Our Xcode accept this type of Json file (Json Schema File)

--

--