I'm using the following code to merge 2 typesDefs to one:
import { mergeTypeDefs } from '@graphql-tools/merge';
import topicsTypes from '../modules/topics/typeDefs';
import contentTypes from '../modules/content/typeDefs';
const types = [contentTypes, topicsTypes];
export default mergeTypeDefs(types)
When I run graphql-schema-linter I get an error:
22:1 The fields of object type Query should be sorted in alphabetical order. Expected sorting: contentAccessTokenByUUID, documentContent, documentTopics type-fields-sorted-alphabetically
I tried changing the order of the types in the array to [topicsTypes, contentTypes];
But I get the same error, how can I force mergeTypeDefs to merge the defs alphabetically?
Try to import your schemas as shown below
Depending on your file extension edit the following
If you want to check out the doc New mergeTypeDefs-routine from https://www.graphql-tools.com/docs/migration-from-merge-graphql-schemas/
Also might be helpful to check out this https://www.graphql-tools.com/docs/api/interfaces/merge_src.Config#throwonconflict