How to create function to return all common fields in absinthe

Absinthe has a built-in method to reuse fields.

  object :user_fields do
      field :email,
            non_null(:string),
            description: "Email address that will be used to log into the system."

      field :enable,
            :boolean,
            description: "Mark if user is active or not. By default it is active."
  end

  input_object :user_input do
    field :password, non_null(:string),
      description: "Password entered by the user to be registered."

    import_fields :user_fields
  end
2 Likes