{"repo":"ashkan18/graphlient","free":true,"listed":false,"github":"https://github.com/ashkan18/graphlient","clone":"git clone https://github.com/ashkan18/graphlient.git","description":"Ruby GraphQL Client","language":"Ruby","stars":254,"topics":["ruby","graphql","client"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Graphlient A friendlier Ruby client for consuming GraphQL-based APIs. Built on top of your usual graphql-client, but with better defaults, more consistent error handling, and using the faraday HTTP client. Table of Contents - Installation - Usage - Schema Storing and Loading on Disk - Preloading Schema Once - Error Handling - Executing Parameterized Queries and Mutations - Parse and Execute Queries Separately - Build Query Strings without Validation - Dynamic vs. Static Queries - Generate Queries with Graphlient::Query - Fragment Spreads and Definitions in the DSL - Inline Fragments in the DSL - Directives in the DSL - Custom Scalar Types - Create API Client Classes with Graphlient::Extension::Query - Swapping the HTTP Stack - Testing with Graphlient and RSpec - License Installation Add the following line to your Gemfile. Usage Create a new instance of Graphlient::Client with a URL and optional headers/http options. http options default type ------------- ------- ------- read timeout nil seconds write timeout nil seconds The schema is available automatically via .schema . Make queries with query , which takes a String or a block for the query definition. With a String. With a block. This will call the endpoint setup in the configuration with POST , the Authorization header and query as follows. A successful response object always contains data which can be iterated upon. The following example returns the first line item's price. You can also execute mutations the same way. Th","default_branch":null,"files":null,"tree":[],"storefront":"/r/ashkan18","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ashkan18/graphlient/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}