Comments (5)
Ok, I found the issue - the logger
option is documented1 as:
Logger instance that matches
Console
interface of NodeJS
But in fact the resolveLogger
function only uses that option if it's a string designating a module to be loaded.2
That's a bit confusing. Is the problem that of build vs runtime - so we can't really pass an instance because the config is only used to generate TypeScript artifacts so they need to contain the code that instantiated the logger?
I managed to work around it by passing a path to a TypeScript module in the logger option:
{
logger: "./logger"
}
And doing the setup in that file. If it's impossible to pass an instance of the logger in config then I can update the type documentation, but I'd appreciate someone confirming this.
Footnotes
from graphql-mesh.
Just noticed the above doesn't work for production builds because the import isn't handled correctly - Mesh tries to load the file from the .mesh
directory instead of going up one directory similarly to how it handles additional resolvers.
from graphql-mesh.
Actually that option is not supposed to an object as a logger. But a path to a code file that exports an object implements Logger
from @graphql-mesh/types
.
It is a missing documentation in that case.
But after build
, if it doesn't load the module from the path correctly. This is a bug then.
Thanks for the feedback!
Apparently the types there and resolveLogger
need to be fixed.
Would you try to tackle it in a PR?
from graphql-mesh.
I'll take a stab at it. 😊
from graphql-mesh.
Thanks <3 ! Let us know if you need any questions and support!
from graphql-mesh.
Related Issues (20)
- [v1] Support HTTP-callback-based protocol for subscriptions on subgraphs HOT 1
- `additionalResolvers` aren't called on fields added by `additionalTypeDefs` that are nonnullable
- `createNamingConventionTransform` `enumValues` errors on valid enums in openapi schema
- `createRenameTransform` `argRenamer` leads to the post body disappearing from the request
- `createPruneTransform()` resets `@httpOperation` to default GET request
- `loadOpenAPISubgraph` string requires minLength when theres a maxLength
- [v1] Add `schemaHeaders` to introspection queries HOT 2
- Replace `disposablestack` polyfill HOT 4
- Regression: interface implementations are also queried in graphql backend. HOT 1
- Hive docs are out of date
- The Hive integration does not support schema stitched projects where multiple services contribute to the final graph HOT 6
- [v1] mesh-serve print config path in debug mode `DEBUG=1`
- [v1] mesh-serve misleading `@parcel/watcher` warning
- [v1] log requests for mesh-serve
- [v1] move to using `@graphql-hive/yoga` instead of `@graphql-hive/client`
- [v1] tag docker image matching serve-cli versions
- Support for Automatic Persisted Queries to the backend
- [v1] log requests from gateway to proxy/subgraph
- redis distributed caching testing and documentation
- Mesh execution freezes when a plugin does `request.clone()`
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 graphql-mesh.