examples/with-relay-modern-server-express/lib/createRelayEnvironment.js
function fetchQuery (operation, variables, cacheConfig, uploadables) {
  // Because we implement the graphql server, the client must to point to the same host
  const relayServer = process.browser ? '' : process.env.RELAY_SERVER
  return fetch(`${relayServer}/graphql`, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json'
    }, // Add authentication and other headers here
    body: JSON.stringify({
      query: operation.text, // GraphQL text from input
      variables
    })
  }).then(response => response.json())
}
function fetchQuery (operation, variables, cacheConfig, uploadables) {
  // Because we implement the graphql server, the client must to point to the same host
  const relayServer = process.browser ? '' : process.env.RELAY_SERVER
  return fetch(`${relayServer}/graphql`, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json'
    }, // Add authentication and other headers here
    body: JSON.stringify({
      query: operation.text, // GraphQL text from input
      variables
    })
  }).then(response => response.json())
}
Define a function that fetches the results of an operation (query/mutation/etc) and returns its results as a Promise: