This file contains 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
let names = | |
[ | |
{ | |
id: 0, | |
name: 'David' | |
}, | |
{ |
This file contains 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 names = require('./mockdata'); | |
const resolvers = { | |
Query: { | |
getnames: () => { | |
return names; |
This file contains 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 { 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()); |
This file contains 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 { gql } = require('apollo-server-express'); | |
const schema = gql` | |
type Query { | |
getnames: [Names!], | |
} | |
type Names{ | |
id: ID!, |
This file contains 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-boost' | |
export const GET_NAMES = gql` | |
query { | |
getnames{ | |
name | |
} | |
} | |
` |
This file contains 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 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' | |
}) |
This file contains 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 React, { Component } from 'react'; | |
import { GET_NAMES } from './queries.js' | |
import { Query } from 'react-apollo'; | |
class Names extends Component { | |
render() { | |
return ( |
This file contains 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 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'); |
This file contains 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
apply plugin: "com.android.application" | |
// Add the following | |
if (isNewArchitectureEnabled()) { | |
apply plugin: "com.facebook.react" | |
} | |
android { | |
// everything else | |
if (isNewArchitectureEnabled()) { | |
// everything else |
This file contains 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
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() { |
OlderNewer