Skip to content

Instantly share code, notes, and snippets.

View hurali97's full-sized avatar
🎯
Focusing

Muhammad Hur Ali hurali97

🎯
Focusing
View GitHub Profile
@hurali97
hurali97 / mockdata.js
Created July 20, 2019 12:17
Mock Data
let names =
[
{
id: 0,
name: 'David'
},
{
@hurali97
hurali97 / resolver.js
Last active July 20, 2019 13:20
Resolvers
const names = require('./mockdata');
const resolvers = {
Query: {
getnames: () => {
return names;
const express = require('express');
const { ApolloServer } = require('apollo-server-express');
const cors = require('cors');
const schema = require('./graphql/schema');
const resolvers = require('./graphql/resolver');
const app = express();
app.use(cors());
const { gql } = require('apollo-server-express');
const schema = gql`
type Query {
getnames: [Names!],
}
type Names{
id: ID!,
import { gql } from 'apollo-boost'
export const GET_NAMES = gql`
query {
getnames{
name
}
}
`
@hurali97
hurali97 / App.js
Created July 20, 2019 21:57
App.js
import React,{ Component } from 'react';
import ApolloClient from 'apollo-boost'
import { ApolloProvider } from 'react-apollo'
import Names from './Names'
import './App.css';
const client = new ApolloClient({
uri: 'http://localhost:8000/graphql'
})
import React, { Component } from 'react';
import { GET_NAMES } from './queries.js'
import { Query } from 'react-apollo';
class Names extends Component {
render() {
return (
@hurali97
hurali97 / NativeDlog.ts
Last active August 12, 2022 08:34
Spec file for our NativeDlog
import type {TurboModule} from 'react-native';
import {TurboModuleRegistry} from 'react-native';
export interface Spec extends TurboModule {
log(message: string): void;
}
export default TurboModuleRegistry.get<Spec>('Dlog');
apply plugin: "com.android.application"
// Add the following
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
android {
// everything else
if (isNewArchitectureEnabled()) {
// everything else
@hurali97
hurali97 / Dlog.java
Created April 12, 2022 21:19
Dlog module file which inherits NativeDlogSpec.java
package com.rearchdemo.custommodules;
import com.facebook.react.bridge.ReactApplicationContext;
import android.util.Log;
public class Dlog extends NativeDlogSpec {
private static final String TAG = "Dlog";
public static final String NAME = "Dlog";
@Override
public String getName() {