Source for a talk I gave about GraphQL and Elixir/Phoenix.
This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2018-04-08 15:26:22 +12:00
.vscode Client-side subscriptions via Apollo work. 2018-04-08 15:26:22 +12:00
assets Client-side subscriptions via Apollo work. 2018-04-08 15:26:22 +12:00
config Fix timestamps to always create as :utc_datetime. 2018-04-08 12:25:31 +12:00
lib Client-side subscriptions via Apollo work. 2018-04-08 15:26:22 +12:00
priv Add face importing from github. 2018-04-08 10:06:11 +12:00
test Add face importing from github. 2018-04-08 10:06:11 +12:00
.gitignore Empty Phoenix application. 2018-04-08 09:20:53 +12:00
mix.exs Add absinthe-socket-link and send all GraphQL via a Phoenix channel. 2018-04-08 15:00:11 +12:00
mix.lock Add absinthe-socket-link and send all GraphQL via a Phoenix channel. 2018-04-08 15:00:11 +12:00
README.md Add absinthe-socket-link and send all GraphQL via a Phoenix channel. 2018-04-08 15:00:11 +12:00

Extra for experts

Our little React app is pretty neat. When it loads it queries the server for a list of people and shows their faces and allows us to run a mutation to add a new person to our list.

There's only one problem. What happens if someone else comes along and adds a face to our gallery? Our client won't know that the data has changed and will just keep showing us stale data. This is where GraphQL Subscriptions come in.

Absinthe has built-in support for subscriptions and since we're using Phoenix we have a well-tested channel implementation to run it over (Absinthe can use it's own socket protocol too, if you're not running in Phoenix).