Skip to content

Commit

Permalink
Fixes #32896 - Extract Environment GraphQL
Browse files Browse the repository at this point in the history
  • Loading branch information
kamils-iRonin authored and ezr-ondrej committed Jun 30, 2021
1 parent cb65583 commit bbabdd5
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion app/graphql/mutations/hosts/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Create < CreateMutation
argument :owner_id, ID, loads: Types::UserOrUsergroupUnion
argument :location_id, ID, loads: Types::Location
argument :organization_id, ID, loads: Types::Organization
argument :environment_id, ID, loads: Types::Environment
argument :architecture_id, ID, loads: Types::Architecture
argument :domain_id, ID, loads: Types::Domain
argument :operatingsystem_id, ID, loads: Types::Operatingsystem
Expand Down
1 change: 0 additions & 1 deletion app/graphql/types/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Host < BaseObject
belongs_to :compute_resource, Types::ComputeResource
belongs_to :domain, Types::Domain
belongs_to :ptable, Types::Ptable
belongs_to :environment, Types::Environment
belongs_to :location, Types::Location
belongs_to :organization, Types::Organization
belongs_to :model, Types::Model
Expand Down
1 change: 0 additions & 1 deletion app/graphql/types/hostgroup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Hostgroup < BaseObject
belongs_to :architecture, Types::Architecture
belongs_to :compute_resource, Types::ComputeResource
belongs_to :domain, Types::Domain
belongs_to :environment, Types::Environment
belongs_to :operatingsystem, Types::Operatingsystem
belongs_to :puppet_ca_proxy, Types::SmartProxy
belongs_to :puppet_proxy, Types::SmartProxy
Expand Down
1 change: 0 additions & 1 deletion app/graphql/types/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Location < BaseObject
field :name, String
field :title, String

has_many :environments, Types::Environment
has_many :hosts, Types::Host
end
end
2 changes: 0 additions & 2 deletions app/graphql/types/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ class Organization < BaseObject
timestamps
field :name, String
field :title, String

has_many :environments, Types::Environment
end
end
3 changes: 0 additions & 3 deletions app/graphql/types/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ def collection_field(name, type)
record_field :fact_value, Types::FactValue
collection_field :fact_values, Types::FactValue

record_field :environment, Types::Environment
collection_field :environments, Types::Environment

record_field :compute_resource, Types::ComputeResource
collection_field :compute_resources, Types::ComputeResource

Expand Down
12 changes: 1 addition & 11 deletions test/fixtures/taxable_taxonomies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ four:
taxable: one
taxable_type: "SmartProxy"

five:
taxonomy: location1
taxable: production
taxable_type: "Environment"

six:
taxonomy: organization1
taxable: production
taxable_type: "Environment"

seven:
taxonomy: location1
taxable: mydomain
Expand Down Expand Up @@ -212,4 +202,4 @@ bmc_organization:
bmc_location1:
taxonomy: location1
taxable: bmc
taxable_type: "SmartProxy"
taxable_type: "SmartProxy"

0 comments on commit bbabdd5

Please sign in to comment.