Comments (1)
I looked through the code to see if this issue is still needed.
So far it looks like Result
is type Result[T] = Either[Failure, T]
and Failure
is just a wrapper around an error message.
Imo that's not perfect, but also not too bad atm. Replacing Either
with ValidatedNel
only makes sense for independent steps, but a lot of things are sequential in nature, so Either
is fine as a default. If there are things where accumulating errors is possible, using ValidatedNel
and converting the end result to Either
is easy enough now (see Preprocessors.apply
).
So there seem to be two questions left:
- Is the type-alias worth it or would it be clearer to just use
Either
andValidatedNel
directly. - Would it make sense to have error-ADTs describing the different failure-cases as types (which would maybe also require (1) )
My personal thought is that an error-ADT would mostly be useful for testing, but the end-user of the plugin just wants decent error-messages, so the current solution could be sufficient. If we only transport error-messages we may as well keep the type-alias as it is now.
Just my 2 cents 🙂
from sbt-graphql.
Related Issues (20)
- Code generation for unions is flawed HOT 1
- codegen support for 'URI' scalar type HOT 1
- Yet another trouble getting codegen to work HOT 2
- Code generation - The output directory for generated files should be configurable. HOT 1
- Missing Sangria Custom Scalars In Schema Generation HOT 1
- Fix .scalafmt.conf
- Fragment code generation is broken for union types HOT 3
- Stable ordering of output HOT 3
- Add toString to graphqlCodegenStyle, Json HOT 2
- [question] Can I annotate generated classes? HOT 1
- Schema generation from Introspection HOT 5
- How to reorder execution of sbt-graphql plugins? HOT 9
- Code generation question HOT 5
- Examples for common use-cases HOT 5
- about graphql-Java HOT 7
- Multiple schemas generation, is it possible? HOT 8
- Only regenerate Scala files from GraphQL schema if schema changes HOT 1
- Move to github actions HOT 2
- Weird published version v0.1.6 HOT 2
- Question about code generation issue in test phase HOT 6
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 sbt-graphql.