| api_schema | R Documentation |
R6 class for handling the NAMC graphql schema
a namc_oauth2 class (R6 class)
NAMCr::base_class -> api_schema
tpl_pagination_firstis the numeric first record to return
tpl_pagination_offsetis the numeric offset of the return
tpl_pagination_cursoris the cursor used to fetch data at
tpl_page_fieldnameis the name of the field holding page data
required_kindis string value of required argument kind
singular_kindis string value of singular argument kind
array_kindis string value of array argument kind Parse the API types
configure()api_schema$configure()
api_schema For method chaining
types = ( namc_api$new(argList=...) )$get_api_types() schema = api_schema$new(types = types) schema$configure() Parse introspected schema
parse_endpoints()api_schema$parse_endpoints()
api_schema For method chaining
types = ( namc_api$new(argList=...) )$get_api_types() schema = api_schema$new(types = types) schema$parse_endpoints() Discover info on API endpoint
parse_endpoint()api_schema$parse_endpoint(endpoint, special_type = NA)
endpointName of API endpoint to discover
special_typeName of the type of the API endpoint
list Info structure of API details
types = ( namc_api$new(argList=...) )$get_api_types()
schema = api_schema$new(types = types)
schema$parse_endpoint("siteInfo","Query")
Check if argument is numeric
is_arg_numeric()api_schema$is_arg_numeric(endpoint, argname)
endpointString name of api endpoint
argnameString name of api endpoint argument
logical TRUE/FALSE if argument is numeric
Check if argument is numeric
is_arg_boolean()api_schema$is_arg_boolean(endpoint, argname)
endpointString name of api endpoint
argnameString name of api endpoint argument
logical TRUE/FALSE if argument is numeric
Get the sub-type contained within an api endpoint
get_special_type_from_endpoint()api_schema$get_special_type_from_endpoint(endpoint)
endpointString name of api endpoint
Determine if an endpoint has an edge
has_edge()api_schema$has_edge(endpoint)
endpointString name of api endpoint
Get the name of the graphql edge contained in an endpoint
get_edge_name()api_schema$get_edge_name(endpoint)
endpointString name of api endpoint
String name of endpoint edge
Get all available endpoint names
get_endpoints()api_schema$get_endpoints()
Array of endpoint names
Get info about an endpoint
get_endpoint()api_schema$get_endpoint(endpoint)
endpointString name of api endpoint
Get all available field names for an endpoint
get_fields()api_schema$get_fields(endpoint)
endpointString name of api endpoint
Get info about an endpoint field
get_field()api_schema$get_field(endpoint, field)
endpointString name of api endpoint
fieldString name for a field of the endpoint
Get all arguments for and endpoint
get_arguments()api_schema$get_arguments(endpoint, no_paging = FALSE)
endpointString name of api endpoint
no_pagingGet info about an argument
get_argument()api_schema$get_argument(endpoint, argname)
endpointString name of api endpoint
argnameChecks if an argument is required
is_argument_required()api_schema$is_argument_required(endpoint, argname)
endpointString name of api endpoint
argnameChecks if argument name is valid for an endpoint
is_argument()api_schema$is_argument(endpoint, argname)
endpointString name of api endpoint
argnameCheck if endpoint exists
is_endpoint()api_schema$is_endpoint(endpoint)
endpointString name of api endpoint
Describe an Endpoint.
info()info prints text to the console describing an endpoint
api_schema$info(endpoint, no_paging = FALSE, format = "text")
endpointapi endpoint name to get information about.
no_pagingLogical that omits the paging arguments by default
formatOne of: 'markdown', 'text' (default) argument inclusion
This function presents a text block describing an endpoint and its corresponding input parameters. Inputs are marked as required where applicable.
info()
clone()The objects of this class are cloneable with this method.
api_schema$clone(deep = FALSE)
deepWhether to make a deep clone.
types = ( namc_api$new(argList=...) )$get_api_types()
schema = api_schema$new(types = types)
## ------------------------------------------------
## Method `api_schema$configure`
## ------------------------------------------------
types = ( namc_api$new(argList=...) )$get_api_types()
schema = api_schema$new(types = types)
schema$configure()
Parse introspected schema
## ------------------------------------------------
## Method `api_schema$parse_endpoints`
## ------------------------------------------------
types = ( namc_api$new(argList=...) )$get_api_types()
schema = api_schema$new(types = types)
schema$parse_endpoints()
Discover info on API endpoint
## ------------------------------------------------
## Method `api_schema$parse_endpoint`
## ------------------------------------------------
types = ( namc_api$new(argList=...) )$get_api_types()
schema = api_schema$new(types = types)
schema$parse_endpoint("siteInfo","Query")
Check if argument is numeric
## ------------------------------------------------
## Method `api_schema$info`
## ------------------------------------------------
info()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.