poetic / apollo-datasource-graphql

GraphQL/Apollo DataSource to connect to GraphQL API's from your Apollo Server
84 stars 18 forks source link

adds declarations files #11

Closed MakhBeth closed 2 years ago

MakhBeth commented 5 years ago

I've simply added the declaration files configuration to make the project usable without warning in a TS env 👍

timolins commented 5 years ago

In the meantime you can import apollo-datasource-graphql/src instead of apollo-datasource-graphql to import the type-safe version.

ayrtonvwf commented 3 years ago

@timolins wasn't so straightforward to me, not sure if I implemented it correctly, but what worked like a charm to me was to re-export apollo-datasource-graphql/src as a namespaced module.

To do that I created a types.d.ts file with the following content:

declare module "apollo-datasource-graphql" {
  export { GraphQLDataSource } from "apollo-datasource-graphql/src";
}
MakhBeth commented 2 years ago

close due to inactivity