Skip to content

TypeScript Compile Issue #348

@piesrtasty

Description

@piesrtasty

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions