-
Notifications
You must be signed in to change notification settings - Fork 5
Add the option to load the type model definition from file #97
Comments
@b1zzu I really like this feature, we can try to do something like constructor overload. |
Blocked by: #103 |
@vinifarias I've opened a separate issue to discuss how we could improve the TestxServer constructor/api, we can move the discussion there. Btw what's a constructor overload? |
@b1zzu It's when you use multiple constructors for a class, and each of them has different parameters. |
@vinifarias that's not possible in typescript/javascript, the alternative in our case would be to add n optional parameters, but it has this drawback new TestxServer("option one", undefined, undefined, undefined, undefined, "som other options") |
@b1zzu Sorry XD, it's not a good idea to keep this type of constructor with many optional parameters. |
@vinifarias no need to be sorry 😄, in Java it's a good approach because it's possible to define multiple constructors with the same number of arguments |
I plan to use testx with graphback that will use graphql-config. GraphQL Config always passing compiled schema/string. Files are hard as all depends on the __dirname and process.cwd |
It would be nice if it could be possible to do something like this:
but because both the model definition and the file path are strings, in my opinion, something like this is more clear:
or we could expose a helper method:
The text was updated successfully, but these errors were encountered: