add GraphQL API field Query.namespaceByName for easy user/org lookup by name
Created by: sqs
The new GraphQL API query field namespaceByName(name: String!)
makes it easier to look up the user or organization with the given name. Previously callers needed to try looking up the user and organization separately.
Namespaces are used by campaigns and extensions. For example, a campaign alice/my-campaign
is in the alice
namespace, which (presumably) refers to a user with username alice
. A campaign named acme-corp/foo
is owned by the acme-corp
organization.
The src campaign apply -namespace ...
CLI command will use the new namespaceByName
field to simplify resolution of the given namespace name (such as alice
or acme-corp
) to the node ID (of the user or organization whose name was given). Without namespaceByName
, it (and other callers) needed to look up both user(name: "foo")
and organization(name: "foo")
separately, which is repetitive, error-prone, and brittle (if we ever add another type of thing that can be a namespace).