-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helper methods: resolve
#42
Comments
Wouldn't this become a problem on the client? Since the runtime type information is required to initialize the client. Isn't it safe to say that type and resolve code fundamentally always must be separated to prevent the client from accidentally bundling server code? Example: import thing from "huge-server-side-library";
g.type('Query', {
test: g.string().resolve(() => `Hello World: ${thing.computeSomething()}`)
}) |
Great question. I will have to investigate this |
@mishushakov any update? |
Not yet, is this important for you? Why doesn't the existing solution suffice? |
@mishushakov No problem in existing solution but I have issues with schema declarations in separate files. Have difficulties in schema declarations in separate files. g.type('Query', {
test: g.string().resolve(() => 'Hello World')
}) If I have solution like above it will be easy for schema declarations in separate files. |
@ksandin We have now shipped a babel plugin, that will compile some of the runtime information to static artefacts. Of course, we are still exploring other ways to work around that and would love to have your feedback! https://github.com/stepci/garph-gqty#using-the-babel-plugin-alpha |
Specify resolvers directly in schema
Example:
The text was updated successfully, but these errors were encountered: