Skip to content

Commit cfce25f

Browse files
committed
Update index.md to use global client
1 parent 699e935 commit cfce25f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

docs/src/index.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,10 @@ end
204204
GraphQL is often used with microservice architectures. Often, you will find that you have multiple microservices that perform the same GraphQL queries. A nice solution to this is to write a new package which wraps GraphQLClient and provides a higher-level interface, and which also handles connection to the server. For example, the `country` query above could be wrapped as follows
205205

206206
```julia
207-
const CLIENT = Ref(Client)
208-
209-
function connect()
210-
CLIENT[] = Client("url","ws")
211-
end
207+
connect() = global_graphql_client(Client("url","ws"))
212208

213209
function get_country(code)
214210
response = query(
215-
CLIENT[],
216211
"country",
217212
query_args=Dict("code"=>code),
218213
output_fields="name"

0 commit comments

Comments
 (0)