Skip to content

mergeSchemas cannot resolve scalar type in Query, Mutation if type is present by extend #847

@NattapongSiri

Description

@NattapongSiri
  • has-reproduction
  • feature
  • docs
  • blocking
  • good first issue

define type by

type Item {
  name: String
}

then makeExectuableSchema out of it.
define another type

extend type Item {
  cost: Float
}
type Query: {
  findItemCostMoreThan(giveCost: Float): [Item]
}

them mergeSchemas of both. Now it complain that it doesn't know Float.
workaround is to split second definition into extend and query then call mergeSchemas twice.
First with extend type definition. Second with Query.
Based on some of my investigation, mergeSchemas seem to detect type out of compile schema but not on string based schema. So split mergeSchemas into two phrase can workaround this.

This is possibly the same issue with #825 and #815

Metadata

Metadata

Assignees

No one assigned

    Labels

    has-reproduction❤ Has a reproduction in a codesandbox or single minimal repository

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions