This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { GestureHandler } from 'expo'; | |
import { View } from 'react-native'; | |
import Animated from 'react-native-reanimated'; | |
const { PanGestureHandler, State } = GestureHandler; | |
const { | |
event, | |
set, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Mutation { | |
login(email String!, password: String!): String | |
updateProfile: Profile @withEmailVerified | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new ApolloServer({ | |
typeDefs, | |
resolvers, | |
formatError: error => new Error('Internal server error') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shema | |
type Query { | |
getItemById(id: ID!): Item | |
} | |
# Query made by client | |
query myQuery { | |
getItemById(id: "*") { | |
id | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createRateLimitDirective } from 'graphql-rate-limit'; | |
const server = new ApolloServer({ | |
typeDefs: gql` | |
type Mutation { | |
# Limit to 10 per minute | |
login(email: String!, password: String!): String! @rateLimit(max: 10, window: 60000) | |
} | |
`, | |
resolvers: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const updateAnItem = (root, args, ctx) => { | |
return Item.update({ name: args.name }).where({ id: args.id, userId: ctx.userId }); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const updateAnItem = (root, args) => { | |
return Item.update({ name: args.name }).where({ id: args.id }); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Query { | |
getMyData: Data @authenticate | |
somePublicData: String | |
} | |
type Mutation { | |
updateAnItem(id: ID!, name: String!): Item @authenticate | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const server = new ApolloServer({ | |
formatError, | |
resolvers, | |
typeDefs: SCHEMA, | |
engine: false, | |
tracing: true, | |
cacheControl: true, | |
subscriptions: { | |
onConnect: authSubscription |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################## | |
### config.yml ### | |
################## | |
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/python:3.6 | |
steps: |
NewerOlder