Comments (3)
Right now defaults are handled on JS side. You want to reflect that default in schema?
AFAIK, it affects only the visual aspect of graphiql docs:
The behavior is the same as now with defaults in JS.
Technically I could do this for input and args classes but not for inline @Arg()
- I would have to introduce the defaultValue
decorator option which doesn't look good for me 😕
from type-graphql.
Yeah, just schema default values. As of now, I'm just doing nullable with default JS values as you said. But it'd be nice to use the built-in version to get doc support. Although for internal APIs, I'm okay with having nullable args with internal defaults. Can @arg() take options to set defaultValue?
from type-graphql.
Yes, I will emit the defaultValue
in schema for @ArgsType()
and @InputType()
from JS defaults and add an option for @Arg()
decorator. But it's a minor feature with easy workaround so it has low prio for now.
If you want help, you can create a PR for @Arg()
- it should be only a few lines of code to do that, but you would also need to add one test case for that. I would be grateful 😉
from type-graphql.
Related Issues (20)
- isAbstract property doesn't not exist in Resolver() decorator option as opposed to what the documentation says HOT 2
- Inflight is reported as vulnerability in type-graphql HOT 4
- Inherited ObjectTypes don't like Object.assign HOT 2
- Base abstract class is referenced/instantiated when child class should be HOT 2
- 2.0.0-beta.3 breaks semver HOT 2
- Version 2.0.0 emit schema docs example doesn't work HOT 2
- Options for Arg and Args decorators no longer supports custom validate function HOT 3
- Allow support for custom directives on enum values HOT 3
- Server crashes when multiple resolvers fail HOT 4
- @oneOf directive support HOT 1
- Update dependencies versions of type-graphql to allow for Apollo 4 and new GraphQL HOT 1
- Cannot find module 'class-validator' or its corresponding type declarations HOT 1
- Issue with unnamed @InputType() HOT 2
- Nested/2D arrays don't work with union types HOT 2
- directive graphql-rate-limit does not work HOT 6
- `registerEnumType` is not a named export after compilation HOT 15
- The types returned by 'subscribe(...)' are incompatible between these types. HOT 11
- registerEnumType not found in ES module (2.0.0-beta.4) HOT 2
- TypeDoc HOT 2
- Nested objects in queries HOT 1
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 type-graphql.