How to solve `Error : $Unexpected token N in JSON at position 0 ` in react graphql apollo client

Viewed 25

I need guidance on whether I can use an address such as mealDB API or randomuser.com/api in GraphQL or not, and I will post a test code example. I just want to use it in the front to fetch data

    import './App.css';
import React, { FC } from 'react';
import { ApolloClient, InMemoryCache, ApolloProvider } from "@apollo/client"
import ShowUsers from './showUsers';

const client = new ApolloClient({
  uri: 'https://randomuser.me/api/',

  cache: new InMemoryCache(),
})

const App= () => {
  return (
    <ApolloProvider client={client}>
      <ShowUsers />
    </ApolloProvider>
 );
}

export default App;
0 Answers
Related