Created
May 1, 2020 18:09
-
-
Save giovannibenussi/22a7da9def124d242e50d22204532b72 to your computer and use it in GitHub Desktop.
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 from 'react' | |
import ApolloClient from 'apollo-boost' | |
import { ApolloProvider } from '@apollo/react-hooks' | |
import Rates from './Rates' | |
import gql from 'graphql-tag' | |
const typeDefs = gql` | |
extend type ExchangeRate { | |
name: String! | |
} | |
` | |
const resolvers = { | |
ExchangeRate: { | |
name: () => 'This is a custom name!' | |
} | |
} | |
const client = new ApolloClient({ | |
uri: 'https://48p1r2roz4.sse.codesandbox.io', | |
typeDefs, | |
resolvers | |
}) | |
function App() { | |
return ( | |
<ApolloProvider client={client}> | |
<div style={{ padding: '0rem 2rem' }}> | |
<h1>Apollo Mocks Demo 🚀</h1> | |
<h2> | |
Everything inside <i>ApolloProvider</i> can make queries using our new configuration! | |
</h2> | |
<Rates /> | |
</div> | |
</ApolloProvider> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment