Error 405 on Strapi request

Hey Strapi forum,

I am getting a 405 Error when attempting a post attached is the snippit that is causing the error.

function Home() {

const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337/api';

console.log(`URL: ${API_URL}`);

const [query, setQuery] = useState('');

const link = new HttpLink({ uri: `${API_URL}/graphql` });

const cache = new InMemoryCache();

const client = new ApolloClient({ link, cache });

return (

    <ApolloProvider client={client}>

        <div className='search'>

            <h2> Local Restaurants</h2>

            <InputGroup>

                <InputGroupAddon addonType='append'> Search </InputGroupAddon>

                <Input

                    onChange={(e) => setQuery(e.target.value.toLocaleLowerCase())}

                    value={query}

                />

            </InputGroup>

            <br></br>

        </div>

        <RestaurantList search={query} />

        <Cart> </Cart>

    </ApolloProvider>

);

}