Skip to content

Instantly share code, notes, and snippets.

View ahmetbicer's full-sized avatar

Ahmet Biçer ahmetbicer

View GitHub Profile
@ahmetbicer
ahmetbicer / app.js
Created September 6, 2020 11:51
GraphQL Express Server
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 });
@ahmetbicer
ahmetbicer / schema_export.js
Created September 6, 2020 11:48
GraphQL export schema
module.exports = new GraphQLSchema({
query:RootQuery,
mutation: Mutation
})
@ahmetbicer
ahmetbicer / schema_mutations.js
Created September 6, 2020 11:44
GraphQL Mutations
const Mutation = new GraphQLObjectType({
name:"Mutation",
fields:{
addUser: {
type: UserType,
args: {
name: { type: GraphQLString }
},
resolve(parent,args){
let user = new User({
@ahmetbicer
ahmetbicer / schema_root_queries.js
Created September 6, 2020 11:27
GraphQL Root Queries
const RootQuery = new GraphQLObjectType({
name: "RootQueryType",
fields:{
user:{
type: UserType,
args:{
id: {
type: GraphQLID
}
},
@ahmetbicer
ahmetbicer / schema_types.js
Created September 6, 2020 09:34
GraphQL defining types
const graphql = require("graphql")
const User = require("../models/user")
const Product = require("../models/product")
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLID,
GraphQLInt,
@ahmetbicer
ahmetbicer / product.js
Created September 6, 2020 09:29
Product Model
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const productSchema = new Schema({
name: String,
stock: Number,
cost: Number,
sellerId: String
})
@ahmetbicer
ahmetbicer / user.js
Created September 6, 2020 09:22
UserModel
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const userSchema = new Schema({
name: String
})
module.exports = mongoose.model("User", userSchema)
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
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
@ahmetbicer
ahmetbicer / log_dump.txt
Created August 6, 2020 13:05
Null Pointer Exception log dump
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