Skip to content

Instantly share code, notes, and snippets.

View nikolasburk's full-sized avatar
😑

Nikolas nikolasburk

😑
View GitHub Profile
@nikolasburk
nikolasburk / DepthFirstSearch.java
Created May 30, 2015 19:26
Implementation of depth first search on a tree data structure (breadth first search yet to come)
public class DepthFirstSearch {
private Tree tree;
private Node result;
public DepthFirstSearch(Tree tree) {
this.tree = tree;
}
public Node depthFirstSearch(String name) {
//
// ViewController.m
// ButtonTest
//
// Created by Nikolas Burk on 08/04/16.
// Copyright © 2016 Nikolas Burk. All rights reserved.
//
#import "ViewController.h"

Using GraphQL with the Apollo iOS client

Were you ever annoyed when working with a REST API because the endpoints didn't give you the data you needed for the views in your app? Getting the right information either required multiple server requests or you had to bug the backend developers to adjust the API? Worry no more, GraphQL and Apollo to the rescue! 🚀

GraphQL is a new API design paradigm that was open-sourced by Facebook in 2015. It introduces a new era for APIs by eliminating a lot of the ineffencies with today's de-facto standard REST. In contrast to REST, GraphQL APIs only expose a single endpoint and the consumer of the API can precisely specify what data they require with every request.

In this tutorial, you're going to build an iPhone app that helps users plan which iOS conferences they'd like to attend. You'll setup your own GraphQL server and interact with it from the app using the [Apollo iOS Client]

Using GraphQL with the Apollo iOS client

Were you ever annoyed when working with a REST API because the endpoints didn't give you the data you needed for the views in your app? Getting the right information either required multiple server requests or you had to bug the backend developers to adjust the API? Worry no more, GraphQL and Apollo to the rescue! 🚀

GraphQL is a new API design paradigm that was open-sourced by Facebook in 2015. It introduces a new era for APIs by eliminating a lot of the ineffencies with today's de-facto standard REST. In contrast to REST, GraphQL APIs only expose a single endpoint and the consumer of the API can precisely specify what data they require with every request.

In this tutorial, you're going to build an iPhone app that helps users plan which iOS conferences they'd like to attend. You'll setup your own GraphQL server and interact with it from the app using the [Apollo iOS Client]

# import Repository from "./github.graphql"
# import Organization from "./github.graphql"
type Query {
info: String!
graphcoolRepositories(names: [String!]): [Repository!]!
graphcool: Organization!
}
# THIS FILE HAS BEEN AUTO-GENERATED BY "PRISMA DEPLOY"
# DO NOT EDIT THIS FILE DIRECTLY
#
# Model Types
#
type Post implements Node {
id: ID!
title: String!
class App extends Component {
render() {
return <div>{this.props.data.hello}</div>
}
}
const HELLO_QUERY = gql`
query hello {
hello
}
const result = await binding.query.user({ id: "user123" }, `{ name }`)
{
"hello": "Hello World"
}
query {
user(id: "user123") {
name
}
}