Skip to content

Access to HTTP Request in resolvers

Compare
Choose a tag to compare
@bwaidelich bwaidelich released this 30 May 12:28

This release comes with one new main feature: A custom GraphQLContext that is available in all resolvers and allows access to the current HTTP request:

<?php
// ...
use Wwwision\GraphQL\GraphQLContext;
// ...

  'resolve' => function ($value, array $args, GraphQLContext $context) {
    $baseUri = $context->getHttpRequest()->getBaseUri();
    // ...
  },

Apart from that this update incorporates some smaller improvements:

  • FEATURE: Upgrade GraphiQL JS lib to v0.10.2
  • FEATURE: Upgrade webonyx/graphql-php to 0.9.8
  • TASK: Add unit test for HttpOptionsComponent
  • TASK: Explicitly set the query action format to JSON
  • TASK: Cosmetic fix to default Settings
  • TASK: Mention Options HTTP Component in README