Strapi GraphQL endpoint?

When I direct my browser to where I have my strapi instance deployed (on AWS EC2)
http://xx.xx.xx.xx:1337/graphql
I see:
Not found

but I can view specific graphql objects I created in browser http://xx.xx.xx.xx:1337/pages

Whats going on here? According to the docs I should see the playground appear. I think my config settings are correct:

  graphql: {
    endpoint: "/graphql",
    shadowCRUD: true,
    playgroundAlways: true,
    depthLimit: 7,
    amountLimit: 100,
    apolloServer: {
      tracing: false
    }
  }
System Information

Node.js version: v12.13.1
NPM version:6.12.1
Strapi version: “3.6.2”
Database: Amazon AWS EC2
Operating system: MacOS 11.3.1

Any help much appreciated

That’s odd, with that variable set to true yes the playground should show up. Can you provide your full plugins.js file config? (Exclude any private keys)

@DMehaffy thanks for the reply. Here’s my plugins.js

module.exports = ({ env }) => ({
  upload: {
    provider: "aws-s3",
    providerOptions: {
      accessKeyId: env("AWS_ACCESS_KEY_ID"),
      secretAccessKey: env("AWS_ACCESS_SECRET"),
      region: env("AWS_REGION"),
      params: {
        Bucket: env("AWS_BUCKET_NAME")
      }
    }
  },
  graphql: {
    endpoint: "/graphql",
    shadowCRUD: true,
    playgroundAlways: true,
    depthLimit: 7,
    amountLimit: 100,
    apolloServer: {
      tracing: false
    }
  }
});

I’m also having issues connecting to graphql from my Nuxt frontend and saw this when debugging (see forum post ). I am thinking it may be related somehow.
Any ideas?

Based on the logs from your other post, this is deployed in a production environment and there is some SSL issues. Can you provide some information as to how and where this is hosted?

Thanks @DMehaffy for the follow up.

Strapi backend setup
I deployed to AWS EC2 instance following this official strapi guide.

Frontend Nuxt setup:
Frontend is hosted using Amazon Amplify hosting following this guide.

Let me know if I can provide any additional info.

The Strapi EC2 Instance, are you using Nginx or some other proxy service?

@DMehaffy No I have not added Nginx / any proxy service.

Can you PM me the server address so I can do a bit of remote testing please?

@DMehaffy Thanks - sent you a PM

Hi @DMehaffy, did you find a solution for @erikwp?

I’m running into the same problem and I’ve managed to identify where the issue lies in plugins.js:

If I export the config as an object, there is no issue and graphql runs as expected in production.

module.exports = {
  graphql: {
    endpoint: "/graphql",
    shadowCRUD: true,
    playgroundAlways: true,
    depthLimit: 7,
    amountLimit: 100,
    introspection: true,
    apolloServer: {
      tracing: false,
    },
  },
};

But if I export the plugins.js file as function with access to env for the aws-s3 plugin, the graphql settings are not enabled, and I can’t access graphql in production.

module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "aws-s3",
      providerOptions: {
        accessKeyId: env("AWS_ACCESS_KEY_ID"),
        secretAccessKey: env("AWS_ACCESS_SECRET"),
        region: env("AWS_REGION"),
        params: {
          Bucket: env("AWS_BUCKET"),
        },
      },
    },
  },
  graphql: {
    endpoint: "/graphql",
    shadowCRUD: true,
    playgroundAlways: true,
    depthLimit: 7,
    amountLimit: 100,
    introspection: true,
    apolloServer: {
      tracing: false,
    },
  },
});

Appreciate any advice, cheers.

@DMehaffy looks like I was missing the config key, correct export function should be:

module.exports = ({ env }) => ({
  graphql: {
    config: {    <<<<< HERE
      endpoint: "/graphql",
      shadowCRUD: true,
      playgroundAlways: true,
      depthLimit: 7,
      amountLimit: 100,
      introspection: true,
      apolloServer: {
        tracing: false,
      },
    },
  },
  upload: {
    config: {
      provider: "aws-s3",
      providerOptions: {
        accessKeyId: env("AWS_ACCESS_KEY_ID"),
        secretAccessKey: env("AWS_ACCESS_SECRET"),
        region: env("AWS_REGION"),
        params: {
          Bucket: env("AWS_BUCKET"),
        },
      },
    },
  },
});