-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Main API for the Blip library #1
Comments
Also pretty important: |
Some more details from chatting around on Slack. If we want Site to be more Site-friendly, we could have a blip.site namespace which specialises with tokens and whatnot. So the interaction in that case could be: (require '[blip.site :as site])
(def site-request
(site/init
(slurp "test/blip/test-query.graphql")
{:endpoint "http://localhost:2021"}))
(site-request "query-entity" {:id "entity-id"}) ;; no token header |
(require '[blip.site :as site])
(def site-request
(site/init
{:endpoint "http://localhost:2021"
:auth-path "/_site/token" ;; optional
:auth-basic {:user "admin" :pass "admin"} ;; optional, defaults to admin:admin
:query-path "/questionnaire/query" ;; Either a string containing the slurped query file or a path on the endpoint
:post-path "/questionnaire/graphql" ;; So blip knows where to post the queries
}))
(site-request "query-entity" {:id "entity-id"}) This would be necessary because
Note that points 1 and 2 are also applicable to the general case (unwrapped) |
As far as it stays all in the Site namespace case, looking good to me to delegate more down to Blip. I wouldn't touch the unwrapped. |
That should be fine provided the user knows to give the entire endpoint including the path and not just the host |
Long term. Some interesting aspects to consider in this similar library: https://github.com/retro/graphql-builder |
Discussing with @herichovadajana we agreed that the following could be a good interface to interact with the Blip library:
When Site is involved (or any other graphql engine that requires more than just an endpoint) we could pass more initialisation parameters, for example:
The text was updated successfully, but these errors were encountered: