Replies: 3 comments 12 replies
-
pika.dev was built with TS + Apollo! That codebase isn't public, but I can definitely say that it's possible. Not sure about Relay though. Based on the docs, it looks like Relay is powered by Babel and then a custom
If anyone can get this working in a repo, I'd love to share a link! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help. I ended up writing https://github.com/bobbyrenwick/snowpack-plugin-graphql to load .graphQL files. I haven't done much package building and just ripped it out of my project as soon as it worked so it's not got much config etc. I would welcome contributors and help! |
Beta Was this translation helpful? Give feedback.
-
the relay babel plugin has an option for specifying es modules: babel.config.json
The only issue I currently have is that the // this is correctly added via the plugin
import _chatUserListQuery from "./__generated__/chatUserListQuery.graphql.js";
import _chatUserList_data from "./__generated__/chatUserList_data.graphql.js";
// this is not correctly removed and causes a runtime error, as there is no export for this :(
// maybe it is snowpack related that this import is not correctly removed?
import { graphql } from '../../_snowpack/pkg/react-relay.js'; Edit: After manually patching
by adding the missing exports, I got it to compiler. However, now it seems like the relay compiler uses |
Beta Was this translation helpful? Give feedback.
-
Would snowpack work with JS / TS with graphql?
Are there any examples / anyone with a project using relay with snowpack?
If so could you make a repo with a minimal example of the config?
(If you're in a similar situation, feel free to chime in!)
Beta Was this translation helpful? Give feedback.
All reactions