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::Schema(3) User Contributed Perl Documentation GraphQL::Schema(3)

GraphQL::Schema - GraphQL schema object

  use GraphQL::Schema;
  use GraphQL::Type::Object;
  my $schema = GraphQL::Schema->new(
    query => GraphQL::Type::Object->new(
      name => 'Query',
      fields => {
        getObject => {
          type => $interfaceType,
          resolve => sub {
            return {};
          }
        }
      }
    )
  );

Class implementing GraphQL schema.

Defaults to the types returned by "registered" in GraphQL::Plugin::Type. Note that this includes the standard scalar types always loaded by GraphQL::Type::Scalar. If you wish to supply an overriding value for this attribute, bear that in mind.

In this schema, returns a hash-ref mapping all types' names to their type object.

In this schema, get all of either the implementation types (if interface) or possible types (if union) of the $abstract_type.

In this schema, is the given $possible_type either an implementation (if interface) or a possibility (if union) of the $abstract_type?

In this schema, does the given $type implement interface $iface? If not, throw exception.

Class method. Takes AST (array-ref of hash-refs) made by "parse" in GraphQL::Language::Parser and returns a schema object. Will not be a complete schema since it will have only default resolvers.

If "\%kind2class" is given, it will override the default mapping of SDL keywords to Perl classes. This is probably most useful for GraphQL::Type::Object. The default is available as %GraphQL::Schema::KIND2CLASS. E.g.

  my $schema = GraphQL::Schema->from_ast(
    $doc,
    { %GraphQL::Schema::KIND2CLASS, type => 'GraphQL::Type::Object::DBIC' }
  );

Makes available the additional types returned by "registered" in GraphQL::Plugin::Type.

Class method. Takes text that is a Schema Definition Language (SDL) (aka Interface Definition Language) document and returns a schema object. Will not be a complete schema since it will have only default resolvers.

As of v0.32, this accepts both old-style "meaningful comments" and new-style string values, as field or type descriptions.

If "\%kind2class" is given, it will override the default mapping of SDL keywords to Perl classes. This is probably most useful for GraphQL::Type::Object. The default is available as %GraphQL::Schema::KIND2CLASS.

Returns Schema Definition Language (SDL) document that describes this schema object.

As of v0.32, this produces the new-style descriptions that are string values, rather than old-style "meaningful comments".

As of v0.33, will not return a description of types supplied with the attribute "types". Obviously, by default this includes types returned by "registered" in GraphQL::Plugin::Type.

In this schema, returns a hash-ref mapping all directives' names to their directive object.

Turns given AST fragment into a type.

If the hash-ref's "type" member is a string, will return a type of that name.

If an array-ref, first element must be either "list" or "non_null", second will be a recursive AST fragment, which will be passed into a recursive call. The result will then have the modifier method ("list" or "non_null") called, and that will be returned.

2021-09-03 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.