Prisma 1 Forum

Can't find my prisma DB

Im am building this React / GraphQL (my first project, woohoo! project, but when I push to heroku I only get undefined back from the DB.

I get a http Endpoint from Prisma.io and then I use it in my prisma.yml and my .graphqlconfig files.

As for the index.js it looks like this:

const httpLink = new HttpLink({
  uri: "https://jaktiajonkoping-se-5635c54306.herokuapp.com/Jaktia-final-prod/prod"
});

const wsLink = new WebSocketLink({
  uri: "wss://jaktiajonkoping-se-5635c54306.herokuapp.com/Jaktia-final-prod/prod",

  options: {
    reconnect: true,
    connectionParams: {
      authToken: localStorage.getItem("Jaktiatoken")
    }
  }
});

const authLink = new ApolloLink((operation, forward) => {
  // Retrive the authorization token from local storage.
  const token = localStorage.getItem("Jaktiatoken");

  // Use the set Context method to set the HTTP headers.
  operation.setContext({
    headers: {
      authorization: token ? `Bearer ${token}` : ""
    }
  });

  // Call the next link in the middleware chain.
  return forward(operation);
});

const link = split(
  ({ query }) => {
    const { kind, operation } = getMainDefinition(query);
    return kind === "OperationDefinition" && operation === "subscription";
  },
  wsLink,
  authLink.concat(httpLink)
);

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

ReactDOM.render(
  <BrowserRouter>
    <AuthProvider>
      <ApolloProvider client={client}>
        <App />
      </ApolloProvider>
    </AuthProvider>
  </BrowserRouter>,
  document.getElementById("root")
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();

export { client };

Am I missing something obvious here?

Help would be much appreciated

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.