Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare(strict_types=1); /* * The resolvers for "product" and "article" run asynch..
Decoded Output download
<?php declare(strict_types=1);
/*
* The resolvers for "product" and "article" run asynchronously.
* This can have big advantages if you fetch data from different microservices.
* Keep in mind everything in "call" should be non-blocking, check out async libraries like amphp/mysql, amphp/http-client.
*/
use Amp\Promise;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Schema;
use function Amp\call;
return new Schema([
'query' => new ObjectType([
'name' => 'Query',
'fields' => [
'product' => [
'type' => Type::string(),
'resolve' => fn (): Promise => call(
// use inside the closure e.g. amphp/mysql, amphp/http-client, ...
fn (): string => 'xyz'
),
],
'article' => [
'type' => Type::string(),
'resolve' => fn (): Promise => call(
// use inside the closure e.g. amphp/mysql, amphp/http-client, ...
fn (): string => 'zyx'
),
],
],
]),
]);
?>
Did this file decode correctly?
Original Code
<?php declare(strict_types=1);
/*
* The resolvers for "product" and "article" run asynchronously.
* This can have big advantages if you fetch data from different microservices.
* Keep in mind everything in "call" should be non-blocking, check out async libraries like amphp/mysql, amphp/http-client.
*/
use Amp\Promise;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Schema;
use function Amp\call;
return new Schema([
'query' => new ObjectType([
'name' => 'Query',
'fields' => [
'product' => [
'type' => Type::string(),
'resolve' => fn (): Promise => call(
// use inside the closure e.g. amphp/mysql, amphp/http-client, ...
fn (): string => 'xyz'
),
],
'article' => [
'type' => Type::string(),
'resolve' => fn (): Promise => call(
// use inside the closure e.g. amphp/mysql, amphp/http-client, ...
fn (): string => 'zyx'
),
],
],
]),
]);
Function Calls
None |
Stats
MD5 | a10bd58b567f96baf9efa28a2f04fa36 |
Eval Count | 0 |
Decode Time | 77 ms |