silverwolf-x's picture
download
raw
844 Bytes
import { ApolloServer } from "@apollo/server";
import { startServerAndCreateNextHandler } from "@as-integrations/next";
import { makeExecutableSchema } from "@graphql-tools/schema";
import { gql } from "graphql-tag";
const typeDefs = gql`
type Query {
users: [User!]!
user(username: String): User
}
type User {
name: String
username: String
}
`;
const users = [
{ name: "Leeroy Jenkins", username: "leeroy" },
{ name: "Foo Bar", username: "foobar" },
];
const resolvers = {
Query: {
users() {
return users;
},
user(parent, { username }) {
return users.find((user) => user.username === username);
},
},
};
export const schema = makeExecutableSchema({ typeDefs, resolvers });
const server = new ApolloServer({
schema,
});
export default startServerAndCreateNextHandler(server);

Xet Storage Details

Size:
844 Bytes
·
Xet hash:
20957957b1aae21054dbfb219d4b88fdb0a97f082a5afc68c6a3ea5ab587d704

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.