gql-dart / ferry

Stream-based strongly typed GraphQL client for Dart
https://ferrygraphql.com/
MIT License
603 stars 116 forks source link

Generating for types with multiple interfaces is either stuck/failing #347

Closed nabilshuja closed 2 years ago

nabilshuja commented 2 years ago

Generating graphql that contains a type which would implement multiple interfaces tend to get stuck.

As an example, generating for graphql is failing on the type Swallow

schema {
    query: Query
}

type Query {
    someSwallow: Swallow!
}

interface Bird {
    wingspan: Int!
}

interface Animal {
    speed: Int!
}

type Swallow implements Animal & Bird {
    wingspan: Int!
    speed: Int!
}

My Pubspec Dependencies:

dependencies:
  hive: ^2.1.0
  hive_flutter: ^1.1.0
  gql_link: ^0.4.2
  gql_http_link: ^0.4.2
  gql_transform_link: ^0.2.2
  gql_error_link: ^0.2.2
  ferry: ^0.10.5-dev.3
  ferry_hive_store: ^0.4.5-dev.1
  gql_code_builder: ^0.5.1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^1.0.4
  build_runner: ^2.1.8
  flutter_gen_runner: ^4.1.6
  json_serializable: ^6.1.5
  ferry_generator: ^0.5.0-dev.10
  envify_generator: ^2.0.2
  gql_build: ^0.4.0
nabilshuja commented 2 years ago

False alarm! I found that the issue was related to circular import that I defined on the fragment itself, when it should've imported another fragment 😅