This file contains hidden or 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 { Animated, ViewStyle, RegisteredStyle, ScrollViewProps, FlatListProps, SectionListProps } from 'react-native'; | |
export interface IProps { | |
/** | |
* A React component that will define the content of the modal. | |
*/ | |
children?: React.ReactNode; | |
/** | |
* A number that will enable the snapping feature and create an intermediate point before opening the modal to full screen. |
This file contains hidden or 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 * as express from 'express'; | |
import * as mongoose from 'mongoose'; | |
import * as http from 'http'; | |
import { ApolloServer } from 'apollo-server-express'; | |
import config from './config'; | |
import schema from './schema'; | |
const app = express(); |
This file contains hidden or 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
version: '3.7' | |
services: | |
mongo: | |
image: mongo:latest | |
volumes: | |
- './mongodb_data:/data/db' | |
ports: | |
- 27017:27017 |
This file contains hidden or 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 ENV = { | |
development: { | |
port: 7000, | |
mongoURI: 'mongodb://localhost:27017/chat-app', | |
}, | |
production: { | |
port: 7000, | |
mongoURI: 'mongodb://localhost:27017/chat-app', | |
}, | |
staging: { |
This file contains hidden or 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
[...] | |
httpServer.listen({ port: config.port }, () => { | |
console.log(`🚀 Server ready at http://localhost:${config.port}${server.graphqlPath}`) | |
console.log(`🚀 Subscriptions ready at ws://localhost:${config.port}${server.subscriptionsPath}`) | |
const connectMongoWithRetry = () => { | |
mongoose | |
.connect(config.mongoURI, { | |
useNewUrlParser: true, | |
useCreateIndex: true, |
This file contains hidden or 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 { gql } from 'apollo-server-express'; | |
const typeDefs = gql` | |
type Message { | |
_id: ID! | |
sender_id: String! | |
senderName: String! | |
text: String! | |
date: Timestamp! | |
} |
This file contains hidden or 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 { GraphQLScalarType } from 'graphql'; | |
import { Kind, ValueNode } from 'graphql/language'; | |
import { gql } from 'apollo-server'; | |
const parse = (v: string) => { | |
if (v === undefined || v === null) { | |
throw new Error('field should be String'); | |
} | |
const str = String(v); |
This file contains hidden or 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 { GraphQLScalarType } from 'graphql'; | |
import { Kind, ValueNode } from 'graphql/language'; | |
import { gql } from 'apollo-server'; | |
const parse = (v: string) => { | |
if (v === undefined || v === null) { | |
throw new Error('field should be String'); | |
} | |
return v; |
This file contains hidden or 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 NEString from './NEString'; | |
import Timestamp from './Timestamp'; | |
export default { | |
declarations: [ | |
NEString.declaration, | |
Timestamp.declaration, | |
], | |
resolvers: { | |
...NEString.type, |
This file contains hidden or 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 { makeExecutableSchema } from 'graphql-tools'; | |
import merge = require('lodash/merge'); | |
import Scalars from './scalars'; | |
// Modules | |
import Messages from './resolvers/Messages'; | |
const Modules = { | |
typeDefs: [ | |
Messages.typeDefs, |