Initial readme.

This commit is contained in:
James Harton 2018-04-08 09:17:28 +12:00
parent b4a66b9c79
commit 9edfb03977

View file

@ -1,28 +1,7 @@
# What the heck is GraphQL anyway?
# Getting started with Absinthe
According to [graphql.org](https://graphql.org/) GraphQL is "A query language
for your API" which is really only part of it.
[Absinthe](https://absinthe-graphql.org/) is an open source implementation of the GraphQL server specification for Elixir. Note that I said "Elixir" there and now "Phoenix". Absinthe doesn't need Phoenix, but we're going to use it in this example because my guess is that not many people are making purely GraphQL services and most of us are probably bolting it on to existing sites or services.
[Demo time](https://www.graphqlhub.com/playground?query={%0A%20%20graphQLHub%0A%20%20giphy%20{%0A%09%09random(tag%3A%22graphql%22)%20{%0A%20%20%20%20%09id%0A%20%20%20%20%20%20url%0A%20%20%20%20%20%20images%20{%0A%20%20%20%20%20%20%20%20original%20{%0A%20%20%20%20%20%20%20%20%20%20url%0A%20%20%20%20%20%20%20%20}%0A%20%20%20%20%20%20}%0A%20%20%09}%0A%20%20}%0A})
Absinthe has [truly amazing docs](https://hexdocs.pm/absinthe/overview.html). Seriously. They're so great. You should check them out.
GraphQL is a specification for the GraphQL query language and how servers and
clients should interact to implement those queries. The [GraphQL
specification](https://github.com/facebook/graphql) is maintained by Facebook
and should probably be treated with care (anyone who has had to maintain a
react-native app knows what I'm talking about). Facebook's philosophy of "move
fast and break things" is great for products but is not great for software
dependencies.
Still, there are plenty of open source implementations of the spec now and you
don't need to rely on Facebook's implementations of the server or client. At
this time my gut feeling is still "avoid react/relay" but I know plenty of
people who have and are building successful apps with them.
Notable efforts include [Apollo](https://www.apollographql.com/), developed by
the [Meteor team](https://www.meteor.com/) it includes a JavaScript server,
browser client and a bunch of other stuff (like bindings for various JavaScript
frameworks). We'll be using the Apollo client in our demonstrations today.
Still, this is an Elixir talk so you're probably most interested in hearing
about [Absinthe](https://absinthe-graphql.org/). Check out the `step-2` branch
to learn about it.
We're going to build a really simple Phoenix application called `faces` which can import a user's name and avatar from GitHub and display a list on a web page.