Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Apr 25, 2024
1 parent f8bb7aa commit f727edf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/graphqlsp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type Logger = (msg: string) => void;

interface Config {
schema: SchemaOrigin;
schemas: SchemaOrigin[];
tadaDisablePreprocessing?: boolean;
templateIsCallExpression?: boolean;
shouldCheckForColocatedFragments?: boolean;
Expand All @@ -39,7 +40,7 @@ function create(info: ts.server.PluginCreateInfo) {
const config: Config = info.config;

logger('config: ' + JSON.stringify(config));
if (!config.schema) {
if (!config.schema && !config.schemas) {
logger('Missing "schema" option in configuration.');
throw new Error('Please provide a GraphQL Schema!');
}
Expand All @@ -52,7 +53,7 @@ function create(info: ts.server.PluginCreateInfo) {

const proxy = createBasicDecorator(info);

const schema = loadSchema(info, config.schema, logger);
const schema = loadSchema(info, config, logger);

proxy.getSemanticDiagnostics = (filename: string): ts.Diagnostic[] => {
const originalDiagnostics =
Expand Down

0 comments on commit f727edf

Please sign in to comment.