graphql-client
This module uses a library call req to make a graphq request to a given url
Installation
dagger install github.com/ernesto27/daggerverse/graphql-client@v0.0.2
Entrypoint
Return Type
GraphqlClient
Example
dagger -m github.com/ernesto27/daggerverse/graphql-client@4cb24780bf873462609a91551a37c4eb9a394edb call \
func (m *myModule) example() *GraphqlClient {
return dag.
GraphqlClient()
}
@function
def example() -> dag.GraphqlClient:
return (
dag.graphql_client()
)
@func()
example(): GraphqlClient {
return dag
.graphqlClient()
}
Types
GraphqlClient 🔗
request() 🔗
Make a request to a graphql endpoint and returns a json response
Example usage: dagger call graphql-request –url “https://countries.trevorblades.com/” –message=“query {countries {name}}” stdout
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
url | String ! | - | The url of the graphql server |
message | String ! | - | The graphql query definition |
file | File | - | The file name that have the graphql query definition |
Example
dagger -m github.com/ernesto27/daggerverse/graphql-client@4cb24780bf873462609a91551a37c4eb9a394edb call \
request --url string --message string
func (m *myModule) example(url string, message string) *Container {
return dag.
GraphqlClient().
Request(url, message)
}
@function
def example(url: str, message: str) -> dagger.Container:
return (
dag.graphql_client()
.request(url, message)
)
@func()
example(url: string, message: string): Container {
return dag
.graphqlClient()
.request(url, message)
}