Skip to content

Commit 4ce99a6

Browse files
committed
Add GraphQL query for schema hmrc_manual
This was generated using `GraphqlQueryBuilder` and then additional fields added manually.
1 parent 763b670 commit 4ce99a6

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

app/graphql/types/edition_type.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,12 @@ class WhipOrganisation < Types::BaseObject
144144
field :sort_order, Integer
145145
end
146146

147+
field :acronym, String
147148
field :body, String
148149
field :brand, String
149150
field :change_history, GraphQL::Types::JSON
151+
field :change_notes, GraphQL::Types::JSON
152+
field :child_section_groups, GraphQL::Types::JSON
150153
field :current, Boolean
151154
field :default_news_image, Image
152155
field :display_date, Types::ContentApiDatetime
@@ -156,6 +159,7 @@ class WhipOrganisation < Types::BaseObject
156159
field :image, Image
157160
field :international_delegations, [EditionType], null: false
158161
field :logo, Logo
162+
field :organisation_govuk_status, String
159163
field :political, Boolean
160164
field :privy_counsellor, Boolean
161165
field :reshuffle, GraphQL::Types::JSON
@@ -170,6 +174,8 @@ class WhipOrganisation < Types::BaseObject
170174

171175
field :active, Boolean, null: false
172176
field :analytics_identifier, String
177+
field :api_path, String
178+
field :api_url, String
173179
field :base_path, String
174180
field :change_history, GraphQL::Types::JSON
175181
field :content_id, ID
@@ -198,6 +204,7 @@ class WhipOrganisation < Types::BaseObject
198204
field :title, String, null: false
199205
field :updated_at, Types::ContentApiDatetime
200206
field :web_url, String
207+
field :withdrawn, Boolean
201208
field :withdrawn_notice, WithdrawnNotice
202209

203210
def details(lookahead:)

app/models/edition.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def redirect?
196196
def withdrawn?
197197
unpublished? && unpublishing.withdrawal?
198198
end
199+
alias_method :withdrawn, :withdrawn?
199200

200201
def substitute?
201202
unpublished? && unpublishing.substitute?
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
class Queries::Graphql::HmrcManualQuery
2+
def self.query(base_path:)
3+
<<~QUERY
4+
{
5+
edition(base_path: "#{base_path}") {
6+
... on Edition {
7+
analytics_identifier
8+
base_path
9+
content_id
10+
description
11+
details {
12+
change_notes
13+
child_section_groups
14+
}
15+
document_type
16+
first_published_at
17+
links {
18+
available_translations {
19+
api_path
20+
api_url
21+
base_path
22+
content_id
23+
document_type
24+
locale
25+
public_updated_at
26+
schema_name
27+
title
28+
web_url
29+
withdrawn
30+
}
31+
organisations {
32+
analytics_identifier
33+
api_path
34+
api_url
35+
base_path
36+
content_id
37+
details {
38+
acronym
39+
brand
40+
default_news_image {
41+
alt_text
42+
url
43+
}
44+
logo {
45+
crest
46+
formatted_title
47+
}
48+
organisation_govuk_status
49+
}
50+
document_type
51+
locale
52+
schema_name
53+
title
54+
web_url
55+
withdrawn
56+
}
57+
primary_publishing_organisation {
58+
analytics_identifier
59+
api_path
60+
api_url
61+
base_path
62+
content_id
63+
details {
64+
acronym
65+
brand
66+
default_news_image {
67+
alt_text
68+
url
69+
}
70+
logo {
71+
crest
72+
formatted_title
73+
}
74+
organisation_govuk_status
75+
}
76+
document_type
77+
locale
78+
schema_name
79+
title
80+
web_url
81+
withdrawn
82+
}
83+
suggested_ordered_related_items {
84+
api_path
85+
api_url
86+
base_path
87+
content_id
88+
document_type
89+
locale
90+
public_updated_at
91+
schema_name
92+
title
93+
web_url
94+
withdrawn
95+
}
96+
}
97+
locale
98+
phase
99+
public_updated_at
100+
publishing_app
101+
publishing_request_id
102+
publishing_scheduled_at
103+
rendering_app
104+
scheduled_publishing_delay_seconds
105+
schema_name
106+
title
107+
updated_at
108+
}
109+
}
110+
}
111+
QUERY
112+
end
113+
end

0 commit comments

Comments
 (0)