Skip to content

Commit

Permalink
Merge pull request #15 from pankgeorg/main
Browse files Browse the repository at this point in the history
Handle case where operationName is not provided
  • Loading branch information
mmiller-max authored Apr 18, 2022
2 parents 81ac5b2 + 23bee2a commit fc35aa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GraphQLClient"
uuid = "09d831e3-9c21-47a9-bfd8-076871817219"
version = "0.7.4"
version = "0.7.5"

[deps]
GraphQLParser = "0ae10fbf-af58-4883-b66b-ff0ac82d20dd"
Expand Down
4 changes: 2 additions & 2 deletions src/http_execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ julia> GraphQLClient.execute(client, query_string, operation_name="getCountries"
```
"""
execute(query::AbstractString, output_type::Type{T}=Any; kwargs...) where T = execute(global_graphql_client(), query, output_type; kwargs...)
function execute(client::Client, query::AbstractString, output_type::Type{T}=Any; variables=Dict(), operation_name="", kwargs...) where T
function execute(client::Client, query::AbstractString, output_type::Type{T}=Any; variables=Dict(), operation_name=nothing, kwargs...) where T
return execute(client, Dict("query" => query, "variables" => variables, "operationName" => operation_name), output_type; kwargs...)
end
execute(payload::AbstractDict, output_type::Type{T}=Any; kwargs...) where T = execute(global_graphql_client(), payload, output_type; kwargs...)
function execute(client::Client, payload::AbstractDict, output_type::Type{T}=Any; kwargs...) where T
return execute(client.endpoint, payload, client.headers, output_type; kwargs...)
end
function execute(endpoint::AbstractString, query::AbstractString, headers::AbstractDict=Dict(), output_type::Type{T}=Any; variables=Dict(), operation_name="", kwargs...) where T
function execute(endpoint::AbstractString, query::AbstractString, headers::AbstractDict=Dict(), output_type::Type{T}=Any; variables=Dict(), operation_name=nothing, kwargs...) where T
return execute(endpoint, Dict("query" => query, "variables" => variables, "operationName" => operation_name), headers, output_type; kwargs...)
end
function execute(endpoint::AbstractString, payload::AbstractDict, headers::AbstractDict=Dict(), output_type::Type{T}=Any; kwargs...) where T
Expand Down

2 comments on commit fc35aa2

@mmiller-max
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/58678

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.5 -m "<description of version>" fc35aa2d71354827bf54ec037ec431d1d3498579
git push origin v0.7.5

Please sign in to comment.