S
S
Shakir Darion2020-06-15 08:24:44
Node.js
Shakir Darion, 2020-06-15 08:24:44

Error: Field "My.x" already exists in the schema?

it can schema

index.js

import { gql } from "apollo-server-express";
import My from "./My";

const linkSchema = gql`
  type Query {
    my: My
  }
  type My {
    _: Boolean
  }
`;
export default [linkSchema, My];


My.js

import { gql } from "apollo-server-express";

export default gql`
  extend type My {
    x: Int
  }
`;

package.json

"dependencies": {
    "apollo-server": "^2.14.4",
    "apollo-server-express": "^2.14.4",
    "express": "^4.17.1",
    "graphql": "^15.1.0",
  }


when GraphQL version 14 everything works. but when changing to 15 I get an error.

Error: Field "My.x" already exists in the schema. It cannot also be defined in this type extension


what is the reason. How can I fix this error? Thanks in advance. Thanks in advance for your answers.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question