graphql-tools icon indicating copy to clipboard operation
graphql-tools copied to clipboard

`rewireTypes` should recreate types only when necessary

Open yaacovCR opened this issue 3 years ago • 1 comments

see https://github.com/graphql/graphql-js/pull/3596#issuecomment-1130551613

mapSchema changes only the requested types, and then calls rewireTypes which unfortunately recreates ALL schema types. This ensures that all fields on all types are pointing to the new types, but it may often be overkill.

yaacovCR avatar May 18 '22 21:05 yaacovCR

basically, we would have to change rewireTypes to work in two stages, first to crawl the schema and determine what actually needs to be recreated, and then to iterate through that and recreate only what's necessary.

yaacovCR avatar May 18 '22 21:05 yaacovCR