One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| const excludeKeys = ['__fragments', '__id', '__fragmentOwner']; | |
| // strip __fragments, __id, __fragmentOwne | |
| const relayTransform = (key: string, value: string) => { | |
| if (excludeKeys.includes(key)) { | |
| return undefined; | |
| } | |
| return value; | |
| }; |
| module.exports = { | |
| schema: './data/schema.graphql', | |
| language: 'typescript', | |
| src: '../.', | |
| include: [ | |
| './web/src/**', | |
| './shared/src/**', | |
| ], | |
| }; |
| // This is an advanced example! It is not intended for use in application code. | |
| // Libraries like Relay may make use of this technique to save some time on low-end mobile devices. | |
| // Most components should just initiate async requests in componentDidMount. | |
| class ExampleComponent extends React.Component { | |
| _hasUnmounted = false; | |
| state = { | |
| externalData: null, | |
| }; |
| const mapItemSchema = new mongoose.Schema({ | |
| name: String, | |
| location: { | |
| // It's important to define type within type field, because | |
| // mongoose use "type" to identify field's object type. | |
| type: {type: String, default: 'Point'}, | |
| // Default value is needed. Mongoose pass an empty array to | |
| // array type by default, but it will fail MongoDB's pre-save | |
| // validation. | |
| coordinates: {type: [Number], default: [0, 0]} |