Skip to content

Commit

Permalink
[RelayCompilerBin] Don’t include server schema in client extensions.
Browse files Browse the repository at this point in the history
Fixes #2346
  • Loading branch information
alloy committed Mar 6, 2018
1 parent 6d49a52 commit e16c523
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions packages/relay-compiler/bin/RelayCompilerBin.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ Ensure that one such file exists in ${srcDir} or its parents.
const useWatchman = options.watchman && (await WatchmanClient.isAvailable());

const schema = getSchema(schemaPath);

const graphqlSearchOptions = {
extensions: ['graphql'],
include: options.include,
exclude: [path.relative(srcDir, schemaPath)].concat(options.exclude),
};

const parserConfigs = {
js: {
baseDir: srcDir,
Expand All @@ -146,19 +153,11 @@ Ensure that one such file exists in ${srcDir} or its parents.
getParser: DotGraphQLParser.getParser,
getSchema: () => schema,
watchmanExpression: useWatchman
? buildWatchExpression({
extensions: ['graphql'],
include: options.include,
exclude: options.exclude,
})
? buildWatchExpression(graphqlSearchOptions)
: null,
filepaths: useWatchman
? null
: getFilepathsFromGlob(srcDir, {
extensions: ['graphql'],
include: options.include,
exclude: options.exclude,
}),
: getFilepathsFromGlob(srcDir, graphqlSearchOptions),
},
};
const writerConfigs = {
Expand Down

0 comments on commit e16c523

Please sign in to comment.