Skip to content
New issue

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

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

Already on GitHub? # to your account

TypeScript Compile Issue #348

Open
piesrtasty opened this issue Sep 22, 2018 · 10 comments
Open

TypeScript Compile Issue #348

piesrtasty opened this issue Sep 22, 2018 · 10 comments

Comments

@piesrtasty
Copy link

piesrtasty commented Sep 22, 2018

I keep running into the following and can't get the project running :(

Users/lukehamilton/Development/projects/lyra-api/node_modules/ts-node/src/index.ts:261
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/resolvers/Query.ts(22,3): error TS2322: Type '(_parent: QueryParent, _args: {}, ctx: Context) => Promise<PlaceNode[]>' is not assignable to type '(parent: QueryParent, args: {}, ctx: Context, info: GraphQLResolveInfo) => HomeParent[] | Promise<HomeParent[]>'.
  Type 'Promise<PlaceNode[]>' is not assignable to type 'HomeParent[] | Promise<HomeParent[]>'.
    Type 'Promise<PlaceNode[]>' is not assignable to type 'Promise<HomeParent[]>'.
      Type 'PlaceNode[]' is not assignable to type 'HomeParent[]'.
        Type 'PlaceNode' is not assignable to type 'HomeParent'.
          Property 'numRatings' is missing in type 'PlaceNode'.
src/resolvers/Query.ts(24,3): error TS2322: Type '(_parent: QueryParent, { min, max }: ArgsHomesInPriceRange, ctx: Context) => Promise<PlaceNode[]>' is not assignable to type '(parent: QueryParent, args: ArgsHomesInPriceRange, ctx: Context, info: GraphQLResolveInfo) => HomeParent[] | Promise<HomeParent[]>'.
  Type 'Promise<PlaceNode[]>' is not assignable to type 'HomeParent[] | Promise<HomeParent[]>'.
    Type 'Promise<PlaceNode[]>' is not assignable to type 'Promise<HomeParent[]>'.
src/resolvers/Query.ts(33,3): error TS2322: Type '(_parent: QueryParent, _args: {}, ctx: Context) => Promise<RestaurantNode[]>' is not assignable to type '(parent: QueryParent, args: {}, ctx: Context, info: GraphQLResolveInfo) => ReservationParent[] | Promise<ReservationParent[]>'.
  Type 'Promise<RestaurantNode[]>' is not assignable to type 'ReservationParent[] | Promise<ReservationParent[]>'.
    Type 'Promise<RestaurantNode[]>' is not assignable to type 'Promise<ReservationParent[]>'.
      Type 'RestaurantNode[]' is not assignable to type 'ReservationParent[]'.
        Type 'RestaurantNode' is not assignable to type 'ReservationParent'.
          Property 'pictures' is missing in type 'RestaurantNode'.
src/resolvers/Query.ts(35,3): error TS2322: Type '(_parent: QueryParent, _args: {}, ctx: Context) => Promise<NeighbourhoodNode[]>' is not assignable to type '(parent: QueryParent, args: {}, ctx: Context, info: GraphQLResolveInfo) => NeighbourhoodParent[] | Promise<NeighbourhoodParent[]>'.
  Type 'Promise<NeighbourhoodNode[]>' is not assignable to type 'NeighbourhoodParent[] | Promise<NeighbourhoodParent[]>'.
    Type 'Promise<NeighbourhoodNode[]>' is not assignable to type 'Promise<NeighbourhoodParent[]>'.
      Type 'NeighbourhoodNode[]' is not assignable to type 'NeighbourhoodParent[]'.
        Type 'NeighbourhoodNode' is not assignable to type 'NeighbourhoodParent'.
          Property 'city' is missing in type 'NeighbourhoodNode'.
src/resolvers/Query.ts(40,3): error TS2322: Type '(_parent: QueryParent, { cities }: ArgsExperiencesByCity, ctx: Context) => Promise<CityNode[]>' is not assignable to type '(parent: QueryParent, args: ArgsExperiencesByCity, ctx: Context, info: GraphQLResolveInfo) => ExperiencesByCityParent[] | Promise<ExperiencesByCityParent[]>'.
  Type 'Promise<CityNode[]>' is not assignable to type 'ExperiencesByCityParent[] | Promise<ExperiencesByCityParent[]>'.
    Type 'Promise<CityNode[]>' is not assignable to type 'Promise<ExperiencesByCityParent[]>'.
      Type 'CityNode[]' is not assignable to type 'ExperiencesByCityParent[]'.
        Type 'CityNode' is not assignable to type 'ExperiencesByCityParent'.
          Property 'experiences' is missing in type 'CityNode'.

    at createTSError (/Users/lukehamilton/Development/projects/lyra-api/node_modules/ts-node/src/index.ts:261:12)
    at getOutput (/Users/lukehamilton/Development/projects/lyra-api/node_modules/ts-node/src/index.ts:367:40)
    at Object.compile (/Users/lukehamilton/Development/projects/lyra-api/node_modules/ts-node/src/index.ts:558:11)
    at Module.m._compile (/Users/lukehamilton/Development/projects/lyra-api/node_modules/ts-node/src/index.ts:439:43)
    at Module._extensions..js (module.js:664:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/lukehamilton/Development/projects/lyra-api/node_modules/ts-node/src/index.ts:442:12)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
@CristhianParraJS
Copy link

Same here!

@PinkyJie
Copy link

same error for me

@abhiaiyer91
Copy link
Contributor

Looking into this now

@abhiaiyer91
Copy link
Contributor

Alright, this should be resolved!

@plmercereau
Copy link

hello,
it seems it's not :(

@abhiaiyer91
Copy link
Contributor

What is the TS compile error you are receiving?

@plmercereau
Copy link

    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/resolvers/Query.ts(8,3): error TS2322: Type '(_parent: QueryParent, _args: {}, ctx: Context) => Promise<ExperienceNode[]>' is not assignable to type '(parent: QueryParent, args: {}, ctx: Context, info: GraphQLResolveInfo) => ExperienceParent[] | Promise<ExperienceParent[]>'.
  Type 'Promise<ExperienceNode[]>' is not assignable to type 'ExperienceParent[] | Promise<ExperienceParent[]>'.
    Type 'Promise<ExperienceNode[]>' is not assignable to type 'Promise<ExperienceParent[]>'.
      Type 'ExperienceNode[]' is not assignable to type 'ExperienceParent[]'.
        Type 'ExperienceNode' is not assignable to type 'ExperienceParent'.
          Property 'location' is missing in type 'ExperienceNode'.
src/resolvers/Query.ts(11,38): error TS2322: Type 'Promise<PlaceNode[]>' is not assignable to type 'PlaceParent[] | Promise<PlaceParent[]>'.
  Type 'Promise<PlaceNode[]>' is not assignable to type 'Promise<PlaceParent[]>'.
    Type 'PlaceNode[]' is not assignable to type 'PlaceParent[]'.
      Type 'PlaceNode' is not assignable to type 'PlaceParent'.
        Property 'reviews' is missing in type 'PlaceNode'.
src/resolvers/Query.ts(13,5): error TS2322: Type 'Promise<PlaceNode[]>' is not assignable to type 'PlaceParent[] | Promise<PlaceParent[]>'.
  Type 'Promise<PlaceNode[]>' is not assignable to type 'Promise<PlaceParent[]>'.
src/resolvers/Query.ts(22,5): error TS2322: Type 'Promise<RestaurantNode[]>' is not assignable to type 'ReservationParent[] | Promise<ReservationParent[]>'.
  Type 'Promise<RestaurantNode[]>' is not assignable to type 'Promise<ReservationParent[]>'.
    Type 'RestaurantNode[]' is not assignable to type 'ReservationParent[]'.
      Type 'RestaurantNode' is not assignable to type 'ReservationParent'.
        Property 'pictures' is missing in type 'RestaurantNode'.
src/resolvers/Query.ts(24,5): error TS2322: Type 'Promise<NeighbourhoodNode[]>' is not assignable to type 'NeighbourhoodParent[] | Promise<NeighbourhoodParent[]>'.
  Type 'Promise<NeighbourhoodNode[]>' is not assignable to type 'Promise<NeighbourhoodParent[]>'.
    Type 'NeighbourhoodNode[]' is not assignable to type 'NeighbourhoodParent[]'.
      Type 'NeighbourhoodNode' is not assignable to type 'NeighbourhoodParent'.
        Property 'city' is missing in type 'NeighbourhoodNode'.
src/resolvers/Query.ts(29,5): error TS2322: Type 'Promise<CityNode[]>' is not assignable to type 'ExperiencesByCityParent[] | Promise<ExperiencesByCityParent[]>'.
  Type 'Promise<CityNode[]>' is not assignable to type 'Promise<ExperiencesByCityParent[]>'.
    Type 'CityNode[]' is not assignable to type 'ExperiencesByCityParent[]'.
      Type 'CityNode' is not assignable to type 'ExperiencesByCityParent'.
        Property 'experiences' is missing in type 'CityNode'.

I am a bit confused in the new resolvers generators, with the things around Xyz types and XyzParent interfaces, but I guess the error may be related to this

@mikepuglisi
Copy link

mikepuglisi commented Oct 23, 2018

Same problem. Can't run this project due to typescript compilation error

   return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/resolvers/Query.ts(8,3): error TS2322: Type '(_parent: QueryParent, _args: {}, ctx: Context) => Promise<ExperienceNode[]>' is not assignable to type '(parent: QueryParent, args: {}, ctx: Context, info: GraphQLResolveInfo) => ExperienceParent[] | Promise<ExperienceParent[]>'.
  Type 'Promise<ExperienceNode[]>' is not assignable to type 'ExperienceParent[] | Promise<ExperienceParent[]>'.
    Type 'Promise<ExperienceNode[]>' is not assignable to type 'Promise<ExperienceParent[]>'.
      Type 'ExperienceNode[]' is not assignable to type 'ExperienceParent[]'.
        Type 'ExperienceNode' is not assignable to type 'ExperienceParent'.
          Property 'location' is missing in type 'ExperienceNode'.
src/resolvers/Query.ts(11,38): error TS2322: Type 'Promise<PlaceNode[]>' is not assignable to type 'PlaceParent[] | Promise<PlaceParent[]>'.
  Type 'Promise<PlaceNode[]>' is not assignable to type 'Promise<PlaceParent[]>'.
    Type 'PlaceNode[]' is not assignable to type 'PlaceParent[]'.
      Type 'PlaceNode' is not assignable to type 'PlaceParent'.
        Property 'reviews' is missing in type 'PlaceNode'.
src/resolvers/Query.ts(13,5): error TS2322: Type 'Promise<PlaceNode[]>' is not assignable to type 'PlaceParent[] | Promise<PlaceParent[]>'.
  Type 'Promise<PlaceNode[]>' is not assignable to type 'Promise<PlaceParent[]>'.
src/resolvers/Query.ts(22,5): error TS2322: Type 'Promise<RestaurantNode[]>' is not assignable to type 'ReservationParent[] | Promise<ReservationParent[]>'.
  Type 'Promise<RestaurantNode[]>' is not assignable to type 'Promise<ReservationParent[]>'.
    Type 'RestaurantNode[]' is not assignable to type 'ReservationParent[]'.
      Type 'RestaurantNode' is not assignable to type 'ReservationParent'.
        Property 'pictures' is missing in type 'RestaurantNode'.
src/resolvers/Query.ts(24,5): error TS2322: Type 'Promise<NeighbourhoodNode[]>' is not assignable to type 'NeighbourhoodParent[] | Promise<NeighbourhoodParent[]>'.
  Type 'Promise<NeighbourhoodNode[]>' is not assignable to type 'Promise<NeighbourhoodParent[]>'.
    Type 'NeighbourhoodNode[]' is not assignable to type 'NeighbourhoodParent[]'.
      Type 'NeighbourhoodNode' is not assignable to type 'NeighbourhoodParent'.
        Property 'city' is missing in type 'NeighbourhoodNode'.
src/resolvers/Query.ts(29,5): error TS2322: Type 'Promise<CityNode[]>' is not assignable to type 'ExperiencesByCityParent[] | Promise<ExperiencesByCityParent[]>'.
  Type 'Promise<CityNode[]>' is not assignable to type 'Promise<ExperiencesByCityParent[]>'.
    Type 'CityNode[]' is not assignable to type 'ExperiencesByCityParent[]'.
      Type 'CityNode' is not assignable to type 'ExperiencesByCityParent'.
        Property 'experiences' is missing in type 'CityNode'.
src/resolvers/Query.ts(43,17): error TS2322: Type '{ me: null; bookings: null; }' is not assignable to type 'ViewerParent | Promise<ViewerParent | null> | null'.
  Type '{ me: null; bookings: null; }' is not assignable to type 'Promise<ViewerParent | null>'.
    Property 'then' is missing in type '{ me: null; bookings: null; }'.

@abhiaiyer91
Copy link
Contributor

Will be fixed here #376

@abhiaiyer91 abhiaiyer91 reopened this Oct 23, 2018
@plmercereau
Copy link

Awesome!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants