Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giovannibenussi/22a7da9def124d242e50d22204532b72 to your computer and use it in GitHub Desktop.
Save giovannibenussi/22a7da9def124d242e50d22204532b72 to your computer and use it in GitHub Desktop.
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