Help making graphql playground work

Hello guys, i was trying to deploy my Strapi project on Railway. As i remember yesterday it worked but today i've added a custom domain and the website isn't working anymore. I was going to /graphql (for graphql playground) and i have the error "Server cannot be reached" and im not sure why. In localhost Strapi worked on 1337 and in deploy log it say it's running on 6029 (it changes on every deploy), should that be the problem? plugins.js
// ./config/env/production/plugins.js
module.exports = {
graphql: {
config: {
endpoint: '/graphql',
shadowCRUD: true,
playgroundAlways: true,
depthLimit: 7,
amountLimit: 100,
apolloServer: {
tracing: false,
introspection: true,
},
},
},
};
// ./config/env/production/plugins.js
module.exports = {
graphql: {
config: {
endpoint: '/graphql',
shadowCRUD: true,
playgroundAlways: true,
depthLimit: 7,
amountLimit: 100,
apolloServer: {
tracing: false,
introspection: true,
},
},
},
};
Is there a way to make every deploy to run on 1337 maybe that's the problem?
10 Replies
Percy
Percyβ€’16mo ago
Project ID: 07924bb4-bdf2-4b21-a94d-cf733e8969a5
Ene "Splash" Adrian
Ene "Splash" Adrianβ€’16mo ago
07924bb4-bdf2-4b21-a94d-cf733e8969a5
Percy
Percyβ€’16mo ago
No search results found.
⚠️ experimental feature
Brody
Brodyβ€’16mo ago
what console errors do you see?
Ene "Splash" Adrian
Ene "Splash" Adrianβ€’16mo ago
That's what i have in the frontend website console (when trying to fetch data through graphql) {"name":"ApolloError","graphQLErrors":[{"message":"Forbidden access","extensions":{"error":{"name":"ForbiddenError","message":"Forbidden access","details":{}},"code":"FORBIDDEN"}}],"protocolErrors":[],"clientErrors":[],"networkError":null,"message":"Forbidden access"} For /graphql playground (see the image) and for deploy logs i have no error
Brody
Brodyβ€’16mo ago
you haven't set any CSR headers
Ene "Splash" Adrian
Ene "Splash" Adrianβ€’16mo ago
Thanks, i'm gonna search what CSR is first πŸ™‚ After an hour of searching, i found that I have to add
Key: Access-Control-Allow-Origin
Value: https://admin.adpro.uk
Key: Access-Control-Allow-Origin
Value: https://admin.adpro.uk
to routes but I can't find where these are
Brody
Brodyβ€’16mo ago
you are also trying to connect to an http endpoint, so thats no good either
Ene "Splash" Adrian
Ene "Splash" Adrianβ€’16mo ago
apparently that was the problem πŸ™‚ Huge thanks for your time
Brody
Brodyβ€’16mo ago
no problem, sorry I didn't catch it when you first sent the screenshot
Want results from more Discord servers?
Add your server
More Posts