pageballoon / headstart

Decoupled GraphQL-driven content management using OctoberCMS
https://octobercms.com/plugin/nocio-headstart
MIT License
7 stars 2 forks source link

Adding a schema from template breaks /graphql with a 403 Forbidden response #6

Closed jakxnz closed 4 years ago

jakxnz commented 4 years ago

Versions

Nginx: 1.17.6 PHP: 7.4.1 OctoberCMS: 1.0 Build 464 Headstart: 1.2.2

Issue

After creating a schema via the CMS /backend/nocio/headstart/schema, using the "from Template" option, all requests to /graphql respond with 403 Forbidden.

Comments

I notice that a /graphql/headstart/graphs folder is created by the CMS.

Here is an example of making a graphql query with no schemas in place: image

I'm not sure if these issues are caused by the plugin specifically, but any help to get the plugin working would be amazing, thanks.

frthjf commented 4 years ago

Hi @jakxnz,

Thanks for checking out Headstart! From the screenshot it looks like everything works as expected. The error is caused by the fact that the headstart field has no resolver yet. However, you've said you've created a schema 'From Template' but in the screenshot the list appears to be empty, maybe that's what's causing the issue. Could you check that the a template file is being downloaded into the /graphs folder. Maybe there are some writing permission issue when Headstart attempts to download the templates? Alternatively, you could create a file yourself and write our some basic schema + resolver, for example:

  type Query {
   hello: String
  }
function resolveHello() {
return 'world';
}

The other thing to check is if you're nginx server is configured correctly (see here. Easiest way to check is if normal CMS pages work as expected. Let me know how that goes.

frthjf commented 4 years ago

Just realized I might have misread your issue. Are you saying it works fine until you download a template, then you get an 403? In that case it would be useful it you can post the full error message of that 403 and which template is causing is.

frthjf commented 4 years ago

Hi @jakxnz, is this still an issue?

frthjf commented 4 years ago

Closing due to inactivity. Please re-open if still relevant.

jakxnz commented 4 years ago

The other thing to check is if you're nginx server is configured correctly (see here)

@frthjf , this worked for me 👍

(I was using a generic nginx conf)