not sure this is the right place to ask, but i'm h...
# prisma-whats-new
c
not sure this is the right place to ask, but i'm having some trouble querying my graphcool api with
apollo-client
and
isomorphic-fetch
on my localhost (from nodejs). this is the error I get:
Copy code
Error: Network error: request to https://api.graph.cool/simple/v1/[redacted] failed, reason: write EPROTO 140736015500224:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s23_clnt.c:769:
This is on an Express server. It works on the browser side. P.S. Congrats on the Product Hunt launch guys!
n
@calvinl this is a perfect place 🙂
I'm not sure what you mean by
apollo-client
and
isomorphic-fetch
I never ran
apollo-client
with node directly, is that a hard requirement for you?
c
here's my client on the server:
Copy code
const client = new ApolloClient({
    ssrMode: true,
    networkInterface: createNetworkInterface({
      uri: GRAPHQL_ENDPOINT,
      opts: {
        credentials: 'same-origin',
        // https://github.com/matthew-andrews/isomorphic-fetch/issues/83
        headers: req.headers,
      },
    }),
  });
yeah, it's for server-side rendering
^ where
GRAPHQL_ENDPOINT
is the URL to the simple API on graphcool
n
do you have a specific SSL setup that I should be aware of?
c
i don't have SSL on my localhost
could that be the issue?
n
No
what is the reason for the
opts
you're passing?
here's an example with SSR using next
I see that you pass additional headers, what are those? can you try leaving them out?
c
according to that, i need to transfer the request headers to the network interface
yeah, i'll try that
n
awesome, let me know
c
oh!
that worked
i wonder why the documentation in apollo-client adds the headers
either way, i appreciate your help! it was a roadblock last night at 3AM. 🙂 loving your platform so far and all your tutorials, great job! i voted for you guys on product hunt as well
n
awesome! thanks for your support @calvinl
Could you bring that issue up in the Apollo docs issues?
Maybe it's an outdated doc?
c
@nilan sure thing, i'll do that