gds-api-adapters 97.0.0 → 97.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c352a48f1552b0934b7bdd88e8783b8c598b727353559ca6ca30a27877833a6
4
- data.tar.gz: aaba187980a1326a859de794faca1e7e836c5385a32f7d12ea3c9c13a7d5a9ec
3
+ metadata.gz: c727b23d7397797f8a4dc8167fade432fd4161efcc9062942e6f942058bbdfc7
4
+ data.tar.gz: d4f897215feb468597bea8d62cb87c7c92bad5859ab1a7892c010aab99087d59
5
5
  SHA512:
6
- metadata.gz: d06232b4511622aa14a0d8169b338d6f12eb320d38c2c16e0796a6b476c3fc2a9fe54b779fc4f43d886b37978864e24f787c6c6c0c4453a37838f5d0545785d2
7
- data.tar.gz: f7247d52a2e02f6fca017f3b44f2aee212f63ddb3fd868862deb4b005e703bcf412cd74777b3ec1e94145eec476ff70bef7443e9e9426f4dd6f0d12a5d6beeef
6
+ metadata.gz: 8a2de0818203bbd9f62766cbda6cbe7cb2402f87d5123d2a26cd094997dcf9acdb6a82575379329099c9434cdc13b8461abb57036d195c13a2a7e5e01d8fe609
7
+ data.tar.gz: 9663d632dce82d41aaeea134e17fe30334893084d89b0d5c8ac3ae5c8f02c3df804f4e1599fb5017110beec1363c641801ea99d66a98444ad126a9c6fd7e9007
@@ -550,6 +550,15 @@ class GdsApi::PublishingApi < GdsApi::Base
550
550
  get_json("#{endpoint}/v2/schemas/#{schema_name}").to_hash
551
551
  end
552
552
 
553
+ # Make a GraphQL query
554
+ #
555
+ # @param query [String]
556
+ #
557
+ # @return [Hash] A response with the result of the GraphQL query.
558
+ def graphql_query(query)
559
+ post_json("#{endpoint}/graphql", query:).to_hash
560
+ end
561
+
553
562
  private
554
563
 
555
564
  def content_url(content_id, params = {})
@@ -188,6 +188,19 @@ module GdsApi
188
188
  stub_request(:any, /#{PUBLISHING_API_ENDPOINT}\/.*/).to_return(status: 503)
189
189
  end
190
190
 
191
+ # Stub a POST /graphql request
192
+ #
193
+ # @param query [String]
194
+ def stub_publishing_api_graphql_query(query, response_hash = {})
195
+ url = "#{PUBLISHING_API_ENDPOINT}/graphql"
196
+ response = {
197
+ status: 200,
198
+ body: response_hash.to_json,
199
+ headers: { "Content-Type" => "application/json; charset=utf-8" },
200
+ }
201
+ stub_request(:post, url).with(body: { query: }).to_return(response)
202
+ end
203
+
191
204
  # Assert that a draft was saved and published, and links were updated.
192
205
  # - PUT /v2/content/:content_id
193
206
  # - POST /v2/content/:content_id/publish
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "97.0.0".freeze
2
+ VERSION = "97.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 97.0.0
4
+ version: 97.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-17 00:00:00.000000000 Z
11
+ date: 2024-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable