• Content count

  • Joined

  • Last visited

  • Days Won


dadish last won the day on March 31 2017

dadish had the most liked content!

Community Reputation

267 Excellent

About dadish

  • Rank
    Jr. Member
  • Birthday 03/15/1987

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1,271 profile views
  1. Hey @eelkenet! That seems reasonable to me. I was planning to add those fields. Didn't have time till now. I'll let you know as soon as I implement them. You won't be able to add those fields via getQuery hook btw. The getQuery hook is there for very trivial custom fields to be honest. Like your api version number, or your contact data or anything you want to send via GraphQL api without creating templates, fields and pages for it.
  2. Hey everyone! It's been a while since I last had a time to work on this module. But now I finally managed to focus on this module. So here are the latest updates. The codebase of the module grew very big and the more features I added the more time I had to spend to make sure the changes I made does not break anything. Because I had to manually verify if everything works as expected. After long night hours of trial and error I managed to setup tests for this module. Tests will help us quickly add/remove features as needed, because now there is no need for manually verifying all edge cases. Also I setup the Travis-CI so people can contribute more confidently and I can merge pull requests without worrying! There are already bunch of tests, but there is still some I'll be adding. 🎉 🎉 I will add some documentation on how to run tests locally in github wiki pages soon and let you know here. Another thing to note is that the master branch of our module no longer tracks the vendor code. This means that if you download the master branch and put it into your /site/modules directory it will not work. Instead you should use release builds that are a cleaned version of the module. It includes required vendor codes and does not have extra files that are not relevant to ProcessWire. Like presentation gif images, test files and so on. This makes the module size smaller!
  3. PageTable is not supported yet. To be honest I am very busy right now and don't have much time to update this module. So I can't say when additional features will be added. Until then, you'll have to figure out your own way. Sorry
  4. Hey, Rudy! I couldn't fully understand your use case. I guess you want to restrict access to certain entities, like your other site. It is very easy to restrict access to certain ip address. Just before serving GraphQL API you could check for the requested entities ip address and behave accordingly. For example: <?php if ($_SERVER['REMOTE_ADDR'] == ) { echo $modules->get('ProcessGraphQL')->executeGraphQL(); } else { echo 'Access Denied'; } I can't say for sure if that's what you are asking though. If not, please give more details on what you are trying to achieve.
  5. @abdus First of all you don't need to import ProcesGraphQL's vendor.php file. It is done automatically when you do $processGraphQL = modules()->get('ProcessGraphQL'); Second is, I don't see where you include your /site/templates/api/SubscriptionField.php file into graphql.php. So replace the require_once '../modules/ProcessGraphQL/vendor/autoload.php'; with require_once "./api/SubscriptionType.php"; in your graphql.php and it should work. Also, your SubscriptionField class requires the public function getName().
  6. Done! The latest version now allows you to hook into getQuery & getMutation methods of the ProcessGraphQL class. Those hooks are solely there so you could modify the query and mutation operations. Here how it might look like in your template file. <?php namespace ProcessWire; use Youshido\GraphQL\Type\Scalar\StringType; $processGraphQL = $modules->get('ProcessGraphQL'); wire()->addHookAfter('ProcessGraphQL::getQuery', function ($event) { $query = $event->return; $query->addField('hello', [ 'type' => new StringType(), 'resolve' => function () { return 'world!'; } ]); }); echo $processGraphQL->executeGraphQL(); The above code will add a hello field into your GraphQL query that responds with the string "world!". You'll have to use the Youshido\GraphQL library that ProcessGraphQL module uses internally. The same thing could be done with the mutation operation via getMutation hook method.
  7. Well now I am embarrassed. So sorry. It turns out upgrading to the latest graphql library broke some stuff. For some reason I did not check the queries without the selectors. I made some fixes. This should solve your problem. Please get the latest version and try again.
  8. Hi @abdus. You are good to go actually. The argument is required only when there is an exclamation mark after it. It does not have to be = false. Sorry for the confusion, the way I explain it in screencast is a bit misleading. To sum it up, if there is an exclamation mark "!" at the end, it means it is required, of not then it is optional. The = false part means, the default value is false. I know, it sounds stupid. It was a bug in the library I used for this module. I updated it to the latest version since the screencast and now it shows correctly. The = false part is actually is a bug in older version of the module. You probably installed the latest version which shows correctly. So, your version is actually is the way it supposed to be. The version in the screencast is a bit misleading, but still correct.
  9. Unfortunately not yet. I am planning to implement them. But I am a bit busy now and it would definitely take some time to implement it. For now, you will have to do it some other way. Sorry
  10. Yes. It was my bad. I did not make sure the FieldtypeCheckbox always returned a boolean. I think it returns 0/1 in ProcessWire. Anyways, just patched it. Update to the latest version and it should work. Edit: As always, thanks for the feedback.
  11. Yeah, I had my nightmares with this situation too. There are lots of scenarios when ProcessWire could redirect your ajax requests and the graphql will not receive the query. The ones that I had encountered were: If the url ends without slash: ==> If there is now www prefix: ==> And now I guess when languages are enabled you also gotta make sure ProcessWire is not redirecting you to the respective language url of the graphql api. I haven't tested the module with the languages enabled yet, but I am sure there would be some additional caveats. Yes, that's the expected behavior. Unfortunately to support permission inheritance would be too expensive. Because it means to check template permissions of each ancestor of each returned page. I think the module is already slow and supporting permission inheritance would make it even slower. I guess I have to mention about not supporting permission inheritance somewhere in the documentation of the module. That's right, it turns out there was a bug. I pushed an update regarding the datetime field. Grab the latest version of the module and it should work properly. Yep. That's the way. I know, it's ugly. But I can't think of a less verbose way to return a single page from the api. We could, of course introduce an additional field for each template like basic_page_single or something. But I don't think it's worth it, plus it will make the schema bigger for very little gain. I totally agree. We can't allow everyone to create images. The size field of the image type creates images only if the user has an edit permission on that image field. It is still available to the users who do not have edit permission, but only for getting existing variations, and it should return null if there isn't an image variation with the requested size. Edit: By the way, thanks a lot for the feedback.
  12. Sure, by all means. Thanks. I am glad you like it @Soma.
  13. Thanks @adrian! I rerecorded the video many times before I could make it watchable. Trust me, you wouldn't say the same thing for the very first ones About the field access rules. Yeah that's true. By default the behavior is the opposite to the one in ProcessWire. I think it would be better for security if the module initially treats everything private. But I get what you mean. In cases where you have dozens of fields in one template, it would be too tedious to configure access for each of them. That's why there is an option to reverse the behavior in the advanced section of the module configuration. You can learn more about it here. This option basically makes all fields without Access rules available to the public and you can restrict access by enabling rules only to couple ones.
  14. Hi @mvdesign. So sorry that I could not respond earlier. I decided to make an introduction video for this module to help people that are trying to use it. But then, I never made a screencast video before, and on top of that, the last time I spoke english was 2011. So I had to take dozens of try-outs till I got something watchable. So here is the video. It shows how you would create/update pages with this module. The video is far from OK, so I will probably record another one after I get some feedback. Until then please refer to this video to learn about how the module works.
  15. I am happy it works now . The plan is to add support for all core fieldtypes. That includes RepeaterField also. I will try to keep everyone updated via this thread, and you can also keep with the changelog.