Sha256: 36e25cbf28a3461898c8d02405b3e62a1327cc9c84d86b8f77145a4314303f67

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

module Platform
  module Objects
    X = define_active_record_type(-> { ::X }) do
      name "X"
      description "An x on a y."
      visibility :internal
      minimum_accepted_scopes ["z"]

      global_id_field :id
      interfaces [GraphQL::Relay::Node.interface]

      field :f1, !Objects::O1, "The x being y."
      field :f2, !Enums::E1, "x for the y.",
        property: :field_2
      field :f3, Enums::E2, "x for y."
      field :details, types.String, "Details."

      field :f4, !Objects::O2, "x as a y inside the z." do
        argument :a1, !Inputs::I1

        resolve ->(obj_x, arguments, context) do
          Class1.new(
            a: Class2.new(
              b: obj_x.b_1,
              c: obj_x.c_1
            ),
            d: Class3.new(
              b: obj_x.b_2,
              c: obj_x.c_3,
            )
          )
        end
      end

      field :f5, -> { !types.String } do
        description "The thing"
        property :custom_property
        visibility :custom_value
      end

      field :f6, -> { !types.String } do
        description "The thing"
        property :custom_property
        visibility :custom_value
      end

      field :f7, field: SomeField
      field :f8, function: SomeFunction
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graphql-1.8.0.pre6 spec/fixtures/upgrader/type_x.original.rb
graphql-1.8.0.pre5 spec/fixtures/upgrader/type_x.original.rb
graphql-1.8.0.pre4 spec/fixtures/upgrader/type_x.original.rb