Skip to content
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

Property 'fields' of exported interface has or is using private name 'Id' #126

Closed
RaoAkif opened this issue Dec 28, 2021 · 3 comments · Fixed by #128
Closed

Property 'fields' of exported interface has or is using private name 'Id' #126

RaoAkif opened this issue Dec 28, 2021 · 3 comments · Fixed by #128
Assignees
Labels
bug Something isn't working cli

Comments

@RaoAkif
Copy link

RaoAkif commented Dec 28, 2021

I have just added a plain todoSchema, and initialize the project. Right after that run the build command npm run build, and the following type errors came.
Property 'fields' of exported interface has or is using private name 'Id'

The file named testCollectionsTypes.ts contains the code:

import {
  Todo,
  MutationAddTodoArgs,
  MutationUpdateTodoArgs,
  MutationDeleteTodoArgs,
} from "../types";

export type TestCollection = {
  fields: { deleteTodo: { arguments: MutationDeleteTodoArgs; response: Id }[] };
};

The errors in command line were

mock_lambda_layer/mockData/deleteTodo/testCollectionsTypes.ts:9:72 - error TS2304: Cannot find name 'Id'.

9   fields: { deleteTodo: { arguments: MutationDeleteTodoArgs; response: Id }[] };
                                                                         ~~

mock_lambda_layer/mockData/deleteTodo/testCollectionsTypes.ts:9:72 - error TS4033: Property 'fields' of exported interface has or is using private name 'Id'.

9   fields: { deleteTodo: { arguments: MutationDeleteTodoArgs; response: Id }[] };

image

@Muh-Hasan
Copy link
Collaborator

@RaoAkif, Could you please share the schema?

@Muh-Hasan Muh-Hasan added bug Something isn't working cli and removed bug Something isn't working labels Dec 28, 2021
@RaoAkif
Copy link
Author

RaoAkif commented Dec 28, 2021

@RaoAkif, Could you please share the schema?

type Todo {
id: ID!
title: String!
done: Boolean!
}

input TodoInput {
id: ID!
title: String!
done: Boolean!
}
input TodoUpdateInput {
id: ID!
title: String!
done: Boolean!
}

type Query {
getTodos: [Todo]
}

type Mutation {
addTodo(todo: TodoInput!): Todo
updateTodo(todo: TodoUpdateInput!): Todo
deleteTodo(todoId: ID!): ID
}

@mateen7861 mateen7861 self-assigned this Dec 28, 2021
mateen7861 added a commit that referenced this issue Dec 28, 2021
@Muh-Hasan Muh-Hasan linked a pull request Dec 28, 2021 that will close this issue
@Muh-Hasan Muh-Hasan added the bug Something isn't working label Dec 29, 2021
Muh-Hasan added a commit that referenced this issue Dec 29, 2021
@Muh-Hasan
Copy link
Collaborator

Closed by #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants