I used token when accessing a prisma API, but it d...
# prisma-whats-new
s
I used token when accessing a prisma API, but it does not work. The code I used in front-end are:
Copy code
code

    const httpLink2 = new HttpLink(
      {
        uri: '<https://us1.prisma.sh/public-motleyrat-429/prisma-node-adv/dev>',
        headers: {
          "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjamNpNnZneDI1NHhwMDEyOHN6aGsxbDc4IiwiaWF0IjoxNTE2MTQ3NzI5fQ.zDkFMAuQHmguUKGioGBG26ehMYA80RdWW9E3Amf_Kz0"
        }

      },
    );

    const client2 = new ApolloClient({
      link: httpLink2,
      cache: new InMemoryCache(),
    })

    client2.query({ query: gql`{ posts { id
            title
        } }` }).then(() => {
      console.log('finished');
    });
I got this error: Uncaught (in promise) Error: Network error: Server response was missing for query 'null'.