Skip to content

Commit

Permalink
remove unused getSourceDefinitionName
Browse files Browse the repository at this point in the history
Reviewed By: alunyov

Differential Revision: D21742437

fbshipit-source-id: 2957d0674ad4956afdd7c1d6a84f1c8c340a78dd
  • Loading branch information
kassens authored and facebook-github-bot committed May 27, 2020
1 parent 7b5bd9d commit 8bb5809
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
18 changes: 3 additions & 15 deletions packages/relay-compiler/core/GraphQLDerivedFromMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

'use strict';

import type {Fragment, Request, Root, SplitOperation} from './IR';
import type {GeneratedNode} from 'relay-runtime';

/**
Expand All @@ -32,17 +31,6 @@ function getReaderSourceDefinitionName(node: GeneratedNode): string {
return typeof derivedFrom === 'string' ? derivedFrom : name;
}

// Version for IR
function getSourceDefinitionName(
node: Fragment | Request | Root | SplitOperation,
): string {
const derivedFrom =
node.kind === 'Request' ||
node.kind === 'Root' ||
node.kind === 'SplitOperation'
? node.metadata?.derivedFrom
: null;
return typeof derivedFrom === 'string' ? derivedFrom : node.name;
}

module.exports = {getReaderSourceDefinitionName, getSourceDefinitionName};
module.exports = {
getReaderSourceDefinitionName,
};
2 changes: 0 additions & 2 deletions packages/relay-compiler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const {main} = require('./bin/RelayCompilerMain');
const {SourceControlMercurial} = require('./codegen/SourceControl');
const {
getReaderSourceDefinitionName,
getSourceDefinitionName,
} = require('./core/GraphQLDerivedFromMetadata');
const {
formatGeneratedCommonjsModule: formatGeneratedModule,
Expand Down Expand Up @@ -176,7 +175,6 @@ module.exports = {
transformASTSchema: ASTConvert.transformASTSchema,

getReaderSourceDefinitionName,
getSourceDefinitionName,

writeRelayGeneratedFile,

Expand Down

0 comments on commit 8bb5809

Please sign in to comment.