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.1Entrypoint
Return Type
GraphqlClient Example
dagger -m github.com/ernesto27/daggerverse/graphql-client@90753984249c1556ecc426038a954432122a8ff3 call \
func (m *MyModule) Example() *dagger.GraphqlClient {
return dag.
GraphqlClient()
}@function
def example() -> dagger.GraphqlClient:
return (
dag.graphql_client()
)@func()
example(): GraphqlClient {
return dag
.graphqlClient()
}Types
GraphqlClient 🔗
graphqlRequest() 🔗
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@90753984249c1556ecc426038a954432122a8ff3 call \
graphql-request --url string --message stringfunc (m *MyModule) Example(url string, message string) *dagger.Container {
return dag.
GraphqlClient().
GraphqlRequest(url, message)
}@function
def example(url: str, message: str) -> dagger.Container:
return (
dag.graphql_client()
.graphql_request(url, message)
)@func()
example(url: string, message: string): Container {
return dag
.graphqlClient()
.graphqlRequest(url, message)
}