GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
GraphQL::Plugin::Convert::Test(3) User Contributed Perl Documentation GraphQL::Plugin::Convert::Test(3)

GraphQL::Plugin::Convert::Test - GraphQL plugin test class

  package main;
  use GraphQL::Plugin::Convert::Test;
  use GraphQL::Execution qw(execute);
  my $converted = GraphQL::Plugin::Convert::Test->to_graphql;
  print execute(
    $converted->{schema}, '{helloWorld}', $converted->{root_value}
  )->{data}{helloWorld}, "\n";

  # show schema from shell
  perl -Maliased=GraphQL::Plugin::Convert::Test -e 'print Test->to_graphql->{schema}->to_doc'

Example class to allow testing of convert plugin consumers.

Produces a schema and root value that defines the top-level query field "helloWorld". That will return the string "Hello, world!".

Also has a mutation, "echo", that takes a String "s", and returns it.

If the first value is true, it is a "subscribe_resolver", enabling subscriptions in the generated schema. It will be returned as the relevant key in the hash-ref, suitable for being passed as the relevant arg to "subscribe" in GraphQL::Subscription. The schema will have a subscription field "timedEcho" that takes a String "s", and should return it periodically, in a way determined by the subscription function.
2021-02-02 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.