nicode_it
nicode_it
WWasp-lang
Created by nicode_it on 9/14/2024 in #đŸ™‹questions
Apollo GraphQL
Hello How can I use Apollo in Wasp?
import React from 'react';
import * as ReactDOM from 'react-dom/client';
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
import App from './App';

const client = new ApolloClient({
uri: 'https://flyby-router-demo.herokuapp.com/',
cache: new InMemoryCache(),
});

// Supported in React 18+
const root = ReactDOM.createRoot(document.getElementById('root'));

root.render(
<ApolloProvider client={client}>
<App />
</ApolloProvider>,
);
import React from 'react';
import * as ReactDOM from 'react-dom/client';
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
import App from './App';

const client = new ApolloClient({
uri: 'https://flyby-router-demo.herokuapp.com/',
cache: new InMemoryCache(),
});

// Supported in React 18+
const root = ReactDOM.createRoot(document.getElementById('root'));

root.render(
<ApolloProvider client={client}>
<App />
</ApolloProvider>,
);
normally I'd do like this but in wasp I am not sure where to put it.
20 replies