Skip to main content
Version: 1.0-beta

ModuleNaming

API reference​

The names the engine gives a module's own declarations, by the naming rules of the version the module is named by.

Every list-taking field answers in input order.

Implements Node

enumMemberNames(names: [String!]!): [String!]!

The schema names of enum members this module declares, in input order: SCREAMING_SNAKE_CASE.

A name already written in GraphQL's enum member convention (HTTP2, P_256) is kept as it is. With the engine's identifier naming rules, Arm64 is ARM64 and GitHub is GITHUB; with the legacy strcase rules, Arm64 is ARM_64.

Errors on a name the module's naming rules can't parse (non-ASCII, no letters or digits, or over 256 bytes). The legacy rules name anything.

names: [String!]!

The enum member names as the module's source declares them.

fieldNames(names: [String!]!): [String!]!

The schema names of functions, object fields and function arguments this module declares, including interface functions and their arguments, in input order.

With the engine's identifier naming rules, acronyms are written like words: getURL is getUrl, baseURL is baseUrl, HTTPClient is httpClient. With the legacy strcase rules, HTTPClient is httpclient and e2eTest is e2ETest.

Errors on a name the module's naming rules can't parse (non-ASCII, no letters or digits, or over 256 bytes). The legacy rules name anything.

names: [String!]!

The function, field and argument names as the module's source declares them.

id: ID!

A unique identifier for this ModuleNaming.

mainObject(candidates: [String!]!): String

Which of the candidates, the names of objects this module declares, the engine takes as the module's main object; null if none.

The engine finds the main object by the module's name, in any casing: the first candidate, in input order, whose name normalizes to the same type name as the module's, or is spelled as that type name already (K8STools for module k8s-tools, by either rules: strcase spells k8s-tools K8STools, though it would normalize K8STools again to K8Stools). Failing that, with the engine's identifier naming rules only, the only candidate spelled the same once lowercased without word boundaries (Sha256Sum for module sha256sum); several such candidates are ambiguous, and give null.

Errors on a name the module's naming rules can't parse (non-ASCII, no letters or digits, or over 256 bytes). The legacy rules name anything.

candidates: [String!]!

The object names as the module's source declares them.

name: String!

The module's name, which namespaces its types.

originalName: String!

The module's original name, which its main object and namespaced type names are spelled after. It differs from name when the module is loaded under another name, as a dependency alias.

typeNames(names: [String!]!): [String!]!

The schema names of objects, interfaces and enums this module declares, as the engine installs them: namespaced under the module's name, in input order.

A name is prefixed with the module's name unless it already starts with the module's name on a word boundary. With the engine's identifier naming rules: HttpClient in module my-mod is MyModHTTPClient; Postman in module post is PostPostman, while PostMan stays PostMan; K8STools in module k8s-tools is K8sTools, the module's own name. With the legacy strcase rules, HttpClient in module my-mod is MyModHttpClient.

Errors on a name the module's naming rules can't parse (non-ASCII, no letters or digits, or over 256 bytes). The legacy rules name anything.

names: [String!]!

The type names as the module's source declares them.

version: String!

The normalized engine version whose naming rules name the module.

References

Returned by