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 express = require("express") | |
const { graphqlHTTP } = require("express-graphql") | |
const app = express() | |
const schema = require("./schema/schema") | |
const mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/graphqldb', { useUnifiedTopology: true, useNewUrlParser: 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
module.exports = new GraphQLSchema({ | |
query:RootQuery, | |
mutation: Mutation | |
}) |
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 Mutation = new GraphQLObjectType({ | |
name:"Mutation", | |
fields:{ | |
addUser: { | |
type: UserType, | |
args: { | |
name: { type: GraphQLString } | |
}, | |
resolve(parent,args){ | |
let user = new User({ |
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 RootQuery = new GraphQLObjectType({ | |
name: "RootQueryType", | |
fields:{ | |
user:{ | |
type: UserType, | |
args:{ | |
id: { | |
type: GraphQLID | |
} | |
}, |
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 graphql = require("graphql") | |
const User = require("../models/user") | |
const Product = require("../models/product") | |
const { | |
GraphQLSchema, | |
GraphQLObjectType, | |
GraphQLString, | |
GraphQLID, | |
GraphQLInt, |
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 mongoose = require("mongoose"); | |
const Schema = mongoose.Schema; | |
const productSchema = new Schema({ | |
name: String, | |
stock: Number, | |
cost: Number, | |
sellerId: String | |
}) |
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 mongoose = require("mongoose"); | |
const Schema = mongoose.Schema; | |
const userSchema = new Schema({ | |
name: String | |
}) | |
module.exports = mongoose.model("User", userSchema) |
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
08-08 16:35:58.449 3894 3894 D DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl | |
08-08 16:35:58.449 3894 3894 I Ads : This request is sent from a test device. | |
08-08 16:35:58.457 3894 3942 E eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5 | |
08-08 16:35:58.457 1647 3789 I ActivityManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.packageinstaller cmp=com.android.packageinstaller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10066 on display 0 | |
08-08 16:35:58.471 1647 3789 I MediaFocusControl: AudioFocus abandonAudioFocus() from android.media.AudioManager@c7a1bc6expo.modules.av.AVManager@88d567f | |
08-08 16:35:58.477 1647 1798 I AccountManagerService: getTypesVisibleToCaller: isPermitted? true | |
08-08 16:35:58.477 1647 1658 I AccountManagerService: getTypesVisibleToCaller: isPermitted? true | |
08-08 16:35:58.479 3894 3942 E eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5 | |
08-08 16:35:58.485 2380 |
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
08-08 12:00:51.033 7056 7121 I ReactNativeJS: { granted: true, | |
08-08 12:00:51.033 7056 7121 I ReactNativeJS: canAskAgain: true, | |
08-08 12:00:51.033 7056 7121 I ReactNativeJS: status: 'granted', | |
08-08 12:00:51.033 7056 7121 I ReactNativeJS: expires: 'never' } | |
08-08 12:00:51.036 7056 7056 W om.framebyfram: Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed) | |
08-08 12:00:51.040 7056 7056 W om.framebyfram: Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed) | |
08-08 12:00:51.042 7056 7185 W om.framebyfram: Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed) | |
08-08 12:00:51.054 7056 7056 W om.framebyfram: Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Lj |
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
D/EGL_emulation( 4501): eglMakeCurrent: 0xb42b9820: ver 2 0 (tinfo 0xb4236c30) | |
I/art ( 4751): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.exoplayer2.video.MediaCodecVideoRenderer$OnFrameRenderedListenerV23> | |
I/art ( 4751): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.exoplayer2.video.MediaCodecVideoRenderer$OnFrameRenderedListenerV23> | |
I/art ( 4751): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.exoplayer2.video.MediaCodecVideoRenderer$OnFrameRenderedListenerV23> | |
I/art ( 4751): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.exoplayer2.video.MediaCodecVideoRenderer$OnFrameRenderedListenerV23> | |
I/art ( 4751): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.exoplayer2.video.MediaCodecVideoRenderer$OnFrameRenderedListenerV23> | |
I/ExoPlayerImpl( 4751): Init 2c3676ca [ExoPlayerLib/2.9.2] [generic_x86, Android SDK built for x86, unkno |
NewerOlder