-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
TS Error
Type '() => { id: string; email: string; name: string; password: string; posts: null; }' is not assignable to type '{ id: string; email: string; name: string | null; password: string; posts: { id: string; title: string; authorId: string; content: string | null; user: ... | null; }[] | null; }'.ts(2322)
Example code:
I took looks like callbacks are wrong argument for field schema
import { Elysia } from "elysia";
import { yoga } from "@elysiajs/graphql-yoga";
const typeDefs = /* GraphQL */ `
type User {
id: ID!
email: String!
name: String
password: String!
posts: [Post!]
}
type Post {
id: ID!
title: String!
authorId: String!
content: String
user: User
}
`;
export const graphqlYogaPlugin = new Elysia().use(
yoga({
typeDefs,
resolvers: {
Post: {
user: () => {
return {
id: "1",
email: "test",
name: "test",
password: "test",
posts: null,
};
},
},
},
})
);
martykan
Metadata
Metadata
Assignees
Labels
No labels