Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codegen won't show Warning or Error for conflicting Fragments #1803

Open
Jeday opened this issue Feb 13, 2020 · 0 comments
Open

Codegen won't show Warning or Error for conflicting Fragments #1803

Jeday opened this issue Feb 13, 2020 · 0 comments
Labels
🤖 component - codegen related to the codegen core packages

Comments

@Jeday
Copy link

Jeday commented Feb 13, 2020

For example, you have RestaurantSchema.ts:

const RestaurantCityFragment = gql`
fragment CityFragment on City {
    id
    name
    region
  }
`
export const FetchRestaurants = gql`
  query FetchRestaurants {
   Restaurants {
     id
     city{
     ...CityFragment
     }  
    }
  }
  ${CityFragment}
`

and CitySchema.ts:

const CityFragment = gql`
  fragment CityFragment on City {
    id
    name
    slug
  }
`
export const FetchCities = gql`
  query FetchCities {
   Cities {
      ...CityFragment
    }
  }
  ${CityFragment}
`

What one would expect is a warning or a error about naming conflicts in schema that will lead to unpredictable behavior.

But codegen finishes with success and no indication of an error .

Commands run:

apollo client:codegen --target=typescript --outputFlat src/types/api.d.ts 

Version:
apollo: 2.21.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 component - codegen related to the codegen core packages
Projects
None yet
Development

No branches or pull requests

2 participants