Did you know ... Search Documentation:
Pack sourcehut -- prolog/sourcehut/common.pl
PublicShow source

This module provides an interface for interacting with a SourceHut (https://sourcehut.org/) instance, such as https://sr.ht/

 sourcehut_graphql(+Query, -Result, +Options) is semidet
Calls sourcehut_graphql/4 with no query variables.
 sourcehut_graphql(+Query, +Variables, -Result, +Options) is semidet
Performs a GraphQL query specified by the string Query with a remote SourceHut instance. Variables is a dict which assigns values to GraphQL variables that appear in Query.

Result is unified with a dict translated from the server's JSON-formatted response.

Options processed:

scheme(+Scheme),service(+Service),domain(+Domain),port(+Port),path(+Path)
These options are combined to obtain the URL of the remote SourceHut instance. The default values are Scheme=https, service="git", Host="sr.ht", Port=443 and Path="/query"
token(+Token)
Token is an OAuth2 token to be used for authenticating with the remote SourceHut instance. If this option is not provided, sourcehut_token/2 is called as sourcehut_token(Host, Token) to obtain a token. If sourcehut_token/2 fails, the environment variables SOURCEHUT_PL_TOKEN and OAUTH2_TOKEN are consulted for a token. If no token can found, the call fails.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 sourcehut_graphql(Arg1, Arg2, Arg3, Arg4, Arg5)