ardatan / ardatan/graphql-import

How to handle overrides when importing?

Open
#203 24 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
864
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Firstly, I have an example reproduction of the issue I'm facing available here: https://github.com/Siyfion/node-graphql-starter/tree/graphql-import

So what I'm trying to do, is get my Prisma generated schema imported into my Apollo Server 2.0 project. It works fine doing it the way I am, _until_ I re-define a type that's indirectly being imported with `graphql-import`.

Clearly I need a way of merging the schema and when encountering duplicates, using the ones defined in _my_ code over the imported ones, but I can't seem to figure out a way to do this?

FYI the error in the example repo is: `Error: Type "User" was defined more than once.`
This is due to me having defined a custom type for User that adds a `fullname` field to the original schema.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked Siyfion/node-graphql-starter reproduction on the graphql-import branch and reproduce the `Type "User" was defined more than once` error while importing the Prisma-generated schema into Apollo Server 2.0. Done means a locally defined `User` type can add the `fullname` field while the imported schema is merged without the duplicate-definition error.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.