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_first
is the numeric first record to return
tpl_pagination_offset
is the numeric offset of the return
tpl_pagination_cursor
is the cursor used to fetch data at
tpl_page_fieldname
is the name of the field holding page data
required_kind
is string value of required argument kind
singular_kind
is string value of singular argument kind
array_kind
is 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)
endpoint
Name of API endpoint to discover
special_type
Name 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)
endpoint
String name of api endpoint
argname
String 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)
endpoint
String name of api endpoint
argname
String 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)
endpoint
String name of api endpoint
Determine if an endpoint has an edge
has_edge()
api_schema$has_edge(endpoint)
endpoint
String name of api endpoint
Get the name of the graphql edge contained in an endpoint
get_edge_name()
api_schema$get_edge_name(endpoint)
endpoint
String 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)
endpoint
String name of api endpoint
Get all available field names for an endpoint
get_fields()
api_schema$get_fields(endpoint)
endpoint
String name of api endpoint
Get info about an endpoint field
get_field()
api_schema$get_field(endpoint, field)
endpoint
String name of api endpoint
field
String name for a field of the endpoint
Get all arguments for and endpoint
get_arguments()
api_schema$get_arguments(endpoint, no_paging = FALSE)
endpoint
String name of api endpoint
no_paging
Get info about an argument
get_argument()
api_schema$get_argument(endpoint, argname)
endpoint
String name of api endpoint
argname
Checks if an argument is required
is_argument_required()
api_schema$is_argument_required(endpoint, argname)
endpoint
String name of api endpoint
argname
Checks if argument name is valid for an endpoint
is_argument()
api_schema$is_argument(endpoint, argname)
endpoint
String name of api endpoint
argname
Check if endpoint exists
is_endpoint()
api_schema$is_endpoint(endpoint)
endpoint
String 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")
endpoint
api endpoint name to get information about.
no_paging
Logical that omits the paging arguments by default
format
One 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)
deep
Whether 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.