JeffML
1
(Note: function folder was ‘pgnfen’, now ‘server’)
I’m trying to split a project into 1) a lambda functions server & 2) a web client that calls it. A couple of issues.
a) when launching the server locally (via netlify dev), I seem to get a random port #. I think this may be addressed elsewhere (-p flag?).
b) I’m using Apollo GraphQL client. It is configured like so:
const httpLink = createHttpLink({
uri: '/.netlify/functions/pgnfen',
});
const authLink = setContext((_, { headers }) => {
//...
});
const client = new ApolloClient({
link: authLink.concat(httpLink),
cache: new InMemoryCache(),
});
So do I just stick a local (or remote) server address before the uri value? Something like:
- uri: http://localhost:12345/.netlify/functions/pgnfen (local)
- uri: https://pgnfen.netlify.app/.netlify/functions/pgnfen (remote)
Anything else you can think of?
JeffML
2
Okay, I tried the full path link to localhost, but I get a “No data found for resource with given identifier” response. Details as follows:

const httpLink = createHttpLink({
uri: 'http://localhost:8881/.netlify/functions/server',
});
const authLink = setContext((_, { headers }) => {
...
});
const client = new ApolloClient({
link: authLink.concat(httpLink),
cache: new InMemoryCache(),
});
The request (from localhost:8888):
Payload:
It seems like the localhost:8888 request is not finding the functions endpoint on localhost:8881.
JeffML
3
Got past the above issue as described here. Specifically,
- go to
chrome://flags/#block-insecure-private-network-requests
- set
Block insecure private network requests
to Disabled
Now I am getting a “Function not found…” error, which I’ll address in another ticket