Browse Source

Maintenance: Drop default arguments of GraphQL field definitions.

Martin Gruner 2 years ago
parent
commit
f568c9617a

+ 1 - 1
app/graphql/gql/concerns/has_internal_note_field.rb

@@ -7,6 +7,6 @@ module Gql::Concerns::HasInternalNoteField
 
   included do
     # internal note field
-    field :note, String, null: true, authorize: ['ticket.agent', 'admin.*'], description: 'Internal note'
+    field :note, String, authorize: ['ticket.agent', 'admin.*'], description: 'Internal note'
   end
 end

+ 2 - 2
app/graphql/gql/mutations/account/avatar/add.rb

@@ -4,9 +4,9 @@ module Gql::Mutations
   class Account::Avatar::Add < BaseMutation
     description 'Add a new avatar for the currently logged in user.'
 
-    argument :images, Gql::Types::Input::AvatarInputType, required: true, description: 'Images to be uploaded.'
+    argument :images, Gql::Types::Input::AvatarInputType, description: 'Images to be uploaded.'
 
-    field :avatar, Gql::Types::AvatarType, null: true, description: 'The newly created avatar.'
+    field :avatar, Gql::Types::AvatarType, description: 'The newly created avatar.'
 
     def resolve(images:)
       file_full   = images[:full]

+ 1 - 1
app/graphql/gql/mutations/account/avatar/delete.rb

@@ -4,7 +4,7 @@ module Gql::Mutations
   class Account::Avatar::Delete < BaseMutation
     description 'Delete an existing avatar for the currently logged in user.'
 
-    argument :id, GraphQL::Types::ID, required: true, description: 'The unique identifier of the avatar which should be deleted.'
+    argument :id, GraphQL::Types::ID, description: 'The unique identifier of the avatar which should be deleted.'
 
     field :success, Boolean, null: false, description: 'Was the avatar deletion successful?'
 

+ 2 - 2
app/graphql/gql/mutations/organization/update.rb

@@ -4,8 +4,8 @@ module Gql::Mutations
   class Organization::Update < BaseMutation
     description 'Update organization data.'
 
-    argument :id, GraphQL::Types::ID, required: true, description: 'The organization ID', as: :current_organization, loads: Gql::Types::OrganizationType
-    argument :input, Gql::Types::Input::OrganizationInputType, required: true, description: 'The organization data'
+    argument :id, GraphQL::Types::ID, description: 'The organization ID', as: :current_organization, loads: Gql::Types::OrganizationType
+    argument :input, Gql::Types::Input::OrganizationInputType, description: 'The organization data'
 
     field :organization, Gql::Types::OrganizationType, null: false, description: 'The updated organization.'
 

+ 1 - 1
app/graphql/gql/queries/autocomplete_search/user.rb

@@ -5,7 +5,7 @@ module Gql::Queries
 
     description 'Search for users'
 
-    argument :query, String, required: true, description: 'Query from the autocomplete field'
+    argument :query, String, description: 'Query from the autocomplete field'
     argument :limit, Integer, required: false, description: 'Limit for the amount of entries'
 
     type [Gql::Types::AutocompleteEntryType], null: false

+ 1 - 1
app/graphql/gql/queries/form_schema.rb

@@ -5,7 +5,7 @@ module Gql::Queries
 
     description 'Return FormKit schema definition for a given form.'
 
-    argument :form_schema_id, Gql::Types::Enum::FormSchemaIdType, required: true, description: 'Form identifier'
+    argument :form_schema_id, Gql::Types::Enum::FormSchemaIdType, description: 'Form identifier'
 
     type GraphQL::Types::JSON, null: false
 

+ 1 - 1
app/graphql/gql/queries/object_manager/frontend_attributes.rb

@@ -6,7 +6,7 @@ module Gql::Queries
 
       description 'Fetch meta information about object manager attributes for usage in frontend.'
 
-      argument :object, Gql::Types::Enum::ObjectManagerObjectsType, required: true, description: 'Object name to fetch meta information for'
+      argument :object, Gql::Types::Enum::ObjectManagerObjectsType, description: 'Object name to fetch meta information for'
       argument :filter_screen, String, required: false, description: 'Only return attributes that are available on a specific screen'
 
       type [Gql::Types::ObjectManager::FrontendAttributeType], null: false

+ 1 - 1
app/graphql/gql/queries/organization.rb

@@ -5,7 +5,7 @@ module Gql::Queries
 
     description 'Fetch an organization by ID'
 
-    argument :organization_id, GraphQL::Types::ID, required: true, description: 'ID of the organization'
+    argument :organization_id, GraphQL::Types::ID, description: 'ID of the organization'
 
     type Gql::Types::OrganizationType, null: false
 

+ 1 - 1
app/graphql/gql/queries/search.rb

@@ -5,7 +5,7 @@ module Gql::Queries
 
     description 'Generic object search'
 
-    argument :search,  String, required: true, description: 'What to search for'
+    argument :search,  String, description: 'What to search for'
     argument :only_in, Gql::Types::Enum::SearchableModelsType, required: false, description: 'Optionally restrict search to only_in one model'
     argument :limit,   Integer, required: false, description: 'How many entries to find at maximum per model'
 

+ 1 - 1
app/graphql/gql/queries/ticket.rb

@@ -5,7 +5,7 @@ module Gql::Queries
 
     description 'Fetch a ticket by ID'
 
-    argument :ticket, Gql::Types::Input::TicketLocatorInputType, required: true, description: 'Ticket locator'
+    argument :ticket, Gql::Types::Input::TicketLocatorInputType, description: 'Ticket locator'
 
     type Gql::Types::TicketType, null: false
 

Some files were not shown because too many files changed in this diff