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β€’2y ago
Project ID: 07924bb4-bdf2-4b21-a94d-cf733e8969a5
Ene "Splash" Adrian
Ene "Splash" AdrianOPβ€’2y ago
07924bb4-bdf2-4b21-a94d-cf733e8969a5
Percy
Percyβ€’2y ago
No search results found.
⚠️ experimental feature
Brody
Brodyβ€’2y ago
what console errors do you see?
Ene "Splash" Adrian
Ene "Splash" AdrianOPβ€’2y 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β€’2y ago
you haven't set any CSR headers
Ene "Splash" Adrian
Ene "Splash" AdrianOPβ€’2y 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β€’2y ago
you are also trying to connect to an http endpoint, so thats no good either
Ene "Splash" Adrian
Ene "Splash" AdrianOPβ€’2y ago
apparently that was the problem πŸ™‚ Huge thanks for your time
Brody
Brodyβ€’2y ago
no problem, sorry I didn't catch it when you first sent the screenshot
Want results from more Discord servers?
Add your server