-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Deno 1.0 support #4108
Comments
Looking forward to it !! |
Any update???? |
Waiting with baited breath 🙂 |
We're not actively working on this, but it's certainly attractive. We do make use of Node-specific APIs in Apollo Server but could probably abstract that out. |
Do you know the cause of graphql/graphql-js#2566 (comment) ? |
I don't know, but I do see that the graphql-js issue isn't closed, which suggests it's not supposed to work. @IvanGoncharov would know more. |
If I read that comment correctly, I'd be really interested in using Apollo Server on deno as compared to graphql_tools and related some things (like caching support) seem to be just better/easier to use in Apollo Server. |
It seems like this isn't part of a released version of graphql-js, just a tree? But maybe that's how Deno works (loading from git rather than npm) anyway? I don't think anyone on the core team here is an expert on Deno. It seems reasonable to make AS support Deno if it's not too invasive, but this probably will need to largely be contributed by Deno users. |
Adding my voice to those requesting this. I'm a big fan of Deno. I was just trying to convince my company to adopt TypeScript (in Deno) because of the awesome TypeScript libraries for GraphQL. I was surprised to find that Apollo doesn't yet support Deno. 😞 I'd add: Without support, there's risk of folks doing this kind of thing, forking to add Deno support, then leaving an unmaintained fork out in the wild.
Hmm, maybe a fun weekend project. I might take a look. @glasser any recommendations for a new contributor? @ others: Is this not working for you via esm.sh or Deno's new npm compatibility? |
This seems to mostly work for me: #!/usr/bin/env deno run --allow-net --allow-env --allow-read=.
// Minor problem: Every time I run, Deno (re-)tries downloading
// https://esm.sh/v115/@types/graphql@14.5.0/graphql~.d.ts
// looking for types, but ESM says they're not found.
// Something to take up w/ the graphql or esm.sh folks.
import { ApolloServer } from "https://esm.sh/@apollo/server@4.6.0"
import { startStandaloneServer } from 'https://esm.sh/@apollo/server@4.6.0/standalone';
// The GraphQL schema
const typeDefs = `#graphql
type Query {
hello: String
}
`;
// A map of functions which return data for the schema.
const resolvers = {
Query: {
hello: () => 'world',
},
};
const server = new ApolloServer({
typeDefs,
resolvers,
});
const { url } = await startStandaloneServer(server);
console.log(`🚀 Server ready at ${url}`); My test:
|
@NfNitLoop if implementing this in Apollo Server is interesting to you, take a look at this issue. I think what I've outlined there would be sufficient to enforce support for non-node environments in CI (and provide a list of all errors that a non-node env would encounter in its current state - i.e. a list of things that need replacing if we were to support non-node). I'm willing to offer guidance there if you're interested in handling the implementation. |
@trevor-scheer Unfortunately, I don't have time to take that on. But hopefully the working demo above will at least let others see that it's not far off. (Anybody else want to volunteer? 😊) Correct me if I'm wrong, but from my quick investigation yesterday, and the ticket you linked, my summary of Deno support would be:
|
I'm not familiar with the first bullet - but it's definitely possible that using the ESM bundler tree shakes out all of the AS code that requires node builtin libraries (which deno hasn't polyfilled). I do think that some form of automated enforcement would be both the path to the expected outcome (surfacing existing errors) as well as maintaining it / not regressing or breaking support by accident. |
Deno just got released today, do you have any plan for supporting it?
https://deno.land/v1
The text was updated successfully, but these errors were encountered: