ResolverInterface.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Framework\GraphQl\Query;
  8. use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
  9. use Magento\Framework\GraphQl\Config\Element\Field;
  10. use Magento\Framework\GraphQl\Query\Resolver\Value;
  11. use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
  12. /**
  13. * Resolver fetches the data and formats it according to the GraphQL schema.
  14. */
  15. interface ResolverInterface
  16. {
  17. /**
  18. * Fetches the data from persistence models and format it according to the GraphQL schema.
  19. *
  20. * @param \Magento\Framework\GraphQl\Config\Element\Field $field
  21. * @param ContextInterface $context
  22. * @param ResolveInfo $info
  23. * @param array|null $value
  24. * @param array|null $args
  25. * @throws \Exception
  26. * @return mixed|Value
  27. */
  28. public function resolve(
  29. Field $field,
  30. $context,
  31. ResolveInfo $info,
  32. array $value = null,
  33. array $args = null
  34. );
  35. }