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 +4 -4
- data/lib/gds_api/publishing_api.rb +9 -0
- data/lib/gds_api/test_helpers/publishing_api.rb +13 -0
- data/lib/gds_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c727b23d7397797f8a4dc8167fade432fd4161efcc9062942e6f942058bbdfc7
|
4
|
+
data.tar.gz: d4f897215feb468597bea8d62cb87c7c92bad5859ab1a7892c010aab99087d59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/gds_api/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|