diff --git a/docs/graphql/object/flow.md b/docs/graphql/object/flow.md index 52056da8..ad900a1a 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 d24cb1e7..570bd32c 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 054a114d..37786856 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 45ad0fd6..01246f18 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 e95ae993..1c7e9845 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 -%> diff --git a/tooling/graphql/types/codegen.ts b/tooling/graphql/types/codegen.ts index 636f35e2..9f988623 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', } }