From 323c72c18d666a2f952d79129c7a9a55c520b619 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 31 May 2026 09:17:51 +0200 Subject: [PATCH 1/2] fix: correct docs gen --- docs/graphql/object/flow.md | 4 ---- docs/graphql/object/namespace.md | 4 ---- tooling/graphql/docs/helper.rb | 15 ++++++++++----- tooling/graphql/docs/templates/interface.md.erb | 2 +- tooling/graphql/docs/templates/object.md.erb | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/docs/graphql/object/flow.md b/docs/graphql/object/flow.md index 52056da84..ad900a1a7 100644 --- a/docs/graphql/object/flow.md +++ b/docs/graphql/object/flow.md @@ -33,9 +33,5 @@ Returns [`DailyRuntimeUsageConnection!`](../object/dailyruntimeusageconnection.m | Name | Type | Description | |------|------|-------------| -| `after` | [`String`](../scalar/string.md) | Returns the elements in the list that come after the specified cursor. | -| `before` | [`String`](../scalar/string.md) | Returns the elements in the list that come before the specified cursor. | -| `first` | [`Int`](../scalar/int.md) | Returns the first _n_ elements from the list. | | `from` | [`Date`](../scalar/date.md) | Only return usage entries on or after this day | -| `last` | [`Int`](../scalar/int.md) | Returns the last _n_ elements from the list. | | `to` | [`Date`](../scalar/date.md) | Only return usage entries on or before this day | diff --git a/docs/graphql/object/namespace.md b/docs/graphql/object/namespace.md index d24cb1e79..570bd32ce 100644 --- a/docs/graphql/object/namespace.md +++ b/docs/graphql/object/namespace.md @@ -30,12 +30,8 @@ Returns [`DailyRuntimeUsageConnection!`](../object/dailyruntimeusageconnection.m | Name | Type | Description | |------|------|-------------| -| `after` | [`String`](../scalar/string.md) | Returns the elements in the list that come after the specified cursor. | -| `before` | [`String`](../scalar/string.md) | Returns the elements in the list that come before the specified cursor. | -| `first` | [`Int`](../scalar/int.md) | Returns the first _n_ elements from the list. | | `flowId` | [`FlowID`](../scalar/flowid.md) | Only return usage entries for this flow | | `from` | [`Date`](../scalar/date.md) | Only return usage entries on or after this day | -| `last` | [`Int`](../scalar/int.md) | Returns the last _n_ elements from the list. | | `to` | [`Date`](../scalar/date.md) | Only return usage entries on or before this day | ### project diff --git a/tooling/graphql/docs/helper.rb b/tooling/graphql/docs/helper.rb index 054a114d2..37786856f 100644 --- a/tooling/graphql/docs/helper.rb +++ b/tooling/graphql/docs/helper.rb @@ -33,12 +33,16 @@ def connection?(field) type_name.present? && type_name.ends_with?('Connection') end - def arguments?(field) + def documented_arguments(field) args = field[:arguments] - return false if args.blank? - return true unless connection?(field) + return [] if args.blank? + return args unless connection?(field) + + args.reject { |arg| CONNECTION_ARGS.include?(arg[:name]) } + end - args.any? { |arg| CONNECTION_ARGS.exclude?(arg[:name]) } + def arguments?(field) + documented_arguments(field).present? end def render(type, object) @@ -48,7 +52,8 @@ def render(type, object) ).result_with_hash( object: object, sorted_by_name: method(:sorted_by_name), - has_arguments: method(:arguments?) + has_arguments: method(:arguments?), + documented_arguments: method(:documented_arguments) ) [filename, content] diff --git a/tooling/graphql/docs/templates/interface.md.erb b/tooling/graphql/docs/templates/interface.md.erb index 45ad0fd6d..01246f184 100644 --- a/tooling/graphql/docs/templates/interface.md.erb +++ b/tooling/graphql/docs/templates/interface.md.erb @@ -39,7 +39,7 @@ Returns [`<%= field[:type][:info] %>`](../<%= field[:type][:path] %>.md). | Name | Type | Description | |------|------|-------------| -<% sorted_by_name.call(field[:arguments]).each do |argument| -%> +<% sorted_by_name.call(documented_arguments.call(field)).each do |argument| -%> | `<%= argument[:name] %>` | [`<%= argument[:type][:info] %>`](../<%= argument[:type][:path] %>.md) | <%= argument[:description] %> | <% end -%> <% end -%> diff --git a/tooling/graphql/docs/templates/object.md.erb b/tooling/graphql/docs/templates/object.md.erb index e95ae9935..1c7e98451 100644 --- a/tooling/graphql/docs/templates/object.md.erb +++ b/tooling/graphql/docs/templates/object.md.erb @@ -31,7 +31,7 @@ Returns [`<%= field[:type][:info] %>`](../<%= field[:type][:path] %>.md). | Name | Type | Description | |------|------|-------------| -<% sorted_by_name.call(field[:arguments]).each do |argument| -%> +<% sorted_by_name.call(documented_arguments.call(field)).each do |argument| -%> | `<%= argument[:name] %>` | [`<%= argument[:type][:info] %>`](../<%= argument[:type][:path] %>.md) | <%= argument[:description] %> | <% end -%> <% end -%> From 80dec707f99e9f3fc0f7f581b3d71d5e3d95fd0e Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 31 May 2026 09:47:20 +0200 Subject: [PATCH 2/2] feat: added date to codegen --- tooling/graphql/types/codegen.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tooling/graphql/types/codegen.ts b/tooling/graphql/types/codegen.ts index 636f35e2c..9f9886239 100644 --- a/tooling/graphql/types/codegen.ts +++ b/tooling/graphql/types/codegen.ts @@ -39,6 +39,10 @@ const scalars = { Time: { input: 'string', output: 'string', + }, + Date: { + input: 'string', + output: 'string', } }