Skip to content

Instantly share code, notes, and snippets.

Avatar

Philip Nuzhnyi callmephilip

View GitHub Profile
View Fastfile
fastlane_version "1.100.0"
default_platform :ios
platform :ios do
desc "Runs all the tests"
lane :test do
scan
end
View Matchfile
# this must point to the private repository you are gonna use for storing certificates
git_url "git+ssh://git@github.com/callmephilip/todos-certs.git"
type "development"
app_identifier "io.thebakery.todos"
username "developers@thebakery.io"
View parse-graphql-server-resolvers.js
const RootQuery = {
type: new GraphQLList(TodoSchemaType),
resolve: (_, { text }, { Query, user }) => {
const query = new Query(Todo);
return query.find();
}
};
View parse-graphql-server-setup.js
import express from 'express';
import parseGraphQLHTTP from 'parse-graphql-server';
const app = express();
app.use('/graphql', parseGraphQLHTTP({ schema, graphiql: true, }));
app.listen(process.env.PORT, () => {
console.log('server running');
});
View parse-graphql-client.js
import GraphQLClient from 'parse-graphql-client';
const client = new GraphQLClient(settings.graphqlURL, require('parse/react-native'));
client.query(`
{
todos {
id, text, isComplete
}
}
View resolver.js
const RootQuery = {
type: new GraphQLList(TodoSchemaType),
resolve: (_, args, sessionToken) => {
const query = new Parse.Query(Todo);
return query.find({ sessionToken });
}
};
View express-graphql.js
import graphqlHTTP from 'express-graphql';
const app = express();
app.use('/graphql', graphqlHTTP(function(request) {
return {
schema: MyGraphQLSchema,
graphiql: true,
context: sessionToken: request.headers && request.headers.authorization
};
View query.js
const query = new Parse.Query(Todo);
return query.find({ sessionToken });
View app.js
import { View, Platform } from 'react-native';
import React, { Component } from 'react';
import styles from './styles';
import MainNavigation from '../MainNavigation';
import AddTodoItem from '../AddTodoItem';
class App extends Component {
render() {
return (
<View style={ styles.container }>
View main-navigation.js
class MainNavigation extends Component {
render() {
const children = this.props.mainNavigation.children.map( (tab, i) => {
return (
<TabBarIOS.Item key={tab.key}
icon={tab.icon}
selectedIcon={tab.selectedIcon}
title={tab.title} onPress={
() => this.props.onNavigate(JumpToAction(i))
}