Jump to content

GraphQL for ProcessWire


dadish

Recommended Posts

On 3/5/2024 at 10:10 AM, CrazyAppel said:

I could obviously solve this by renaming the options in my dropdown but that would break functionality in other places and would make my work a lot harder. I'm wondering if there is any other approach to this besides renaming the dropdown values.

Not sure what to tell. You can use hooks and create an alias field that would work with GraphQL and add hooks that would sync with your current dropdown field. But that is a bit hacky and will need to be kept up to date with every new logic that involves your dropdown field. You might as well rename your dropdown option names throughout your code if it is just renaming it.

As for the future, my personal advice for ProcessWire users, do not use FieldtypeOptions. Just use FieldtypePage for dropdowns, radio buttons or any type of options field. FieldtypePage takes a bit more time to set up properly as an options field, but in the long run it is always a better approach and much easier to deal with.

On 3/5/2024 at 10:10 AM, CrazyAppel said:

Maybe unrelated to ProcessWire, I'm running a Vue application that executes queries using Axios on my PW backend. Initially, I kept getting a CORS related error:

Sorry, but you'll have to figure that out for yourself. Ask ChatGPT or Google about how to make PHP server to allow requests from any origin.

  • Like 1
Link to comment
Share on other sites

On 3/8/2024 at 8:53 AM, louisstephens said:

I was just curious if anyone has tried installing this lately and ran into any problems regarding "Module requirements are not fulfilled so installing may cause problems."..  The module page lists that the required versions is >= 3.0.62 but when I go to install the module it is saying >= 3.0.210 is required. I am currently running 3.0.98 and if I go through with the install I get a warning regarding that I am not meeting the processwire requirements. It seems to install just fine, but I was just worried of creating other issues if I proceeded.

I updated the requirement in the code but forgot to update the requirements listed in the docs. My bad, I'll try to update it this weekend or so.

Unfortunately we don't have bandwidth to test and support all the ProcessWire versions. So, just to be safe, we default to the later versions. Generally speaking though, ProcessWire is very stable and rarely break anything with patch updates. As long as it works without problems you should be good to go. One thing to keep an eye though, is PHP version. The underlying library (webonyx/graphql-php) requires PHP version `^7.4 || ^8`. So make sure you meet that requirement.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...