Skip to content

Instantly share code, notes, and snippets.

View FabDuarte's full-sized avatar

Fabricio Duarte FabDuarte

View GitHub Profile
@FabDuarte
FabDuarte / settings
Last active January 15, 2018 00:21
Visual studio code settings
{
// Fonts
"editor.fontSize": 16,
"editor.lineHeight": 22,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.letterSpacing": 0.5,
"editor.fontWeight": "400",
// Prettier
"editor.formatOnSave": true,
@FabDuarte
FabDuarte / .eslintrc.js
Created January 15, 2018 01:15
ESLint configuration for React and prettier
module.exports = {
extends: ["airbnb", "prettier", "prettier/react"],
parser: "babel-eslint",
parserOptions: {
ecmaVersion: 8,
ecmaFeatures: {
experimentalObjectRestSpread: true,
impliedStrict: true,
classes: true
}
npm install apollo-boost react-apollo graphql-tag graphql --save
import ApolloClient from "apollo-boost";
const client = new ApolloClient({uri: "https://graphql.org/swapi-graphql/"});
import ApolloClient from "apollo-boost";
import { ApolloProvider, ApolloConsumer } from "react-apollo";
const client = new ApolloClient({
uri: "https://www.graphqlhub.com/graphql",
connectToDevTools: true
});
render() {
return (
import { Query } from "react-apollo";
import gql from "graphql-tag";
const query = gql`{
allFilms {
films {
title
episodeID
director
import gql from "graphql-tag";
const query = gql`{
allFilms {
films {
title
episodeID
director
}
}
import gql from "graphql-tag";
import { Mutation } from "react-apollo";
const ADD_FILM = gql`
mutation addFilm($title: String!, $episodeId: Int!) {
addFilm(title: $title, episodeId, $episodeId) {
eposideId
}
}
`;
import React, { Component } from 'react';
import { View, Text } from 'react-native';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.hello}>Hello world!</Text>
</View>
);
const styles = StyleSheet.create({
container: {
borderRadius: 4,
borderWidth: 0.5,
borderColor: '#d6d7da',
},
title: {
fontSize: 19,
fontWeight: 'bold',
},