Comments (5)
Only thing seems I have not mentioned is setting up the type to module in the packages.json
Ah yep, that triggered the issue!
I believe I've figured it out: the mercurius index.d.ts
is not nodenext compatible, so this will require a fix that would include a small refactor of the index.d.ts
file. For example, the following changes to index.d.ts
would resolve the issue:
type Mercurius = FastifyPluginCallback<mercurius.MercuriusOptions>
declare namespace mercurius {
// ...
export const mercurius: Mercurius
export { mercurius as default }
}
declare module "fastify" {
// ...
}
declare function mercurius(...params: Parameters<Mercurius>): ReturnType<Mercurius>
export = mercurius;
wdyt @mcollina ?
from mercurius.
Yep, absolutely! I'll get that done this week :)
from mercurius.
Hey @iamchathu ! I was unable to replicate the issue using the instructions you provided, are you able to provide a link to a GH repo or your full package.json+package-lock.json for closer inspection? :)
from mercurius.
@jonnydgreen Please refer here. https://github.com/iamchathu/mercurius-ts-example
Only thing seems I have not mentioned is setting up the type to module in the packages.json
from mercurius.
That would be perfect. Can you send a PR?
from mercurius.
Related Issues (20)
- Playground endpoint is not dynamic HOT 2
- Simple subscription example shown in docs fails to push new notifications to client HOT 3
- Occasional "error.originalError.errors.map is not a function" errors HOT 2
- Subscriber.js: Listener not removed on multiple topics
- GraphiQL issues in newest release HOT 2
- local graphiql front-end sources for offline development HOT 1
- Implement Relay style pagination HOT 7
- How to disable `/graphql` route? HOT 1
- Multiple endpoints graphql using Fastify and Mercurius trigger error ' The decorator 'graphql' has already been added! ' HOT 1
- Case for a new hook HOT 2
- Community HOT 1
- Timing problems with nested resolvers throwing errors HOT 1
- fastify-cli and Mercurius HOT 2
- DOC: docs don't have a favicon HOT 3
- Better error messages on passing array of executable schemas. HOT 3
- Support custom directives in mercurius core
- Create a tool kit for schema transformations HOT 1
- Several unit tests checking for errors would pass even if the error isn't thrown HOT 2
- Query caching broken with some custom scalars and JIT HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mercurius.