github-community-projects / graphql-client

A Ruby library for declaring, composing and executing GraphQL queries
MIT License
45 stars 219 forks source link

There's a circular dependency between Schema::ObjectType and Schema::PossibleTypes #22

Closed wuarmin closed 7 months ago

wuarmin commented 7 months ago

Hey @rmosolgo :wave: ,

GraphQL::Client::Schema::ObjectType requires "graphql/client/schema/possible_types" https://github.com/github-community-projects/graphql-client/blob/0980c4c437d313727778c844eac97aa54cedd239/lib/graphql/client/schema/object_type.rb#L6

and GraphQL::Client::Schema::PossibleTypes requires "graphql/client/schema/object_type" https://github.com/github-community-projects/graphql-client/blob/0980c4c437d313727778c844eac97aa54cedd239/lib/graphql/client/schema/possible_types.rb#L5

I think we need to fix this. Otherwise warnings like this will appear

/usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34: warning: /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34: warning: loading in progress, circular require considered harmful - /usr/local/bundle/gems/graphql-client-0.21.0/lib/graphql/client/schema/object_type.rb

Thanks best regards