Skip to content

Commit

Permalink
Revert Relay Classic non-support (#3606)
Browse files Browse the repository at this point in the history
This reverts commit e8551b9.
  • Loading branch information
taion authored and vjeux committed Dec 29, 2017
1 parent 833666a commit cfb8987
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 33 deletions.
9 changes: 5 additions & 4 deletions src/language-js/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ function embed(path, print, textToDoc /*, options */) {
* graphql`...`
* graphql.experimental`...`
* gql`...`
*
* This intentionally excludes Relay Classic tags, as Prettier does not
* support Relay Classic formatting.
*/
if (
parent &&
((parent.type === "TaggedTemplateExpression" &&
((parent.tag.type === "MemberExpression" &&
((parent.tag.object.name === "graphql" &&
parent.tag.property.name === "experimental") ||
(parent.tag.object.name === "Relay" &&
parent.tag.property.name === "QL"))) ||
parent.tag.object.name === "graphql" &&
parent.tag.property.name === "experimental") ||
(parent.tag.type === "Identifier" &&
(parent.tag.name === "gql" || parent.tag.name === "graphql")))) ||
(parent.type === "CallExpression" &&
Expand Down
20 changes: 0 additions & 20 deletions tests/multiparser_js_graphql/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ gql\`

exports[`react-relay.js 1`] = `
const { graphql } = require("react-relay");
const Relay = require("react-relay/classic");
graphql\`
mutation MarkReadNotificationMutation(
Expand All @@ -411,17 +410,8 @@ graphql.experimental\`
)
{ markReadNotification(data: $input ) { notification {seenState} } }
\`;
Relay.QL\`
mutation MarkReadNotificationMutation(
$input
: MarkReadNotificationData!
)
{ markReadNotification(data: $input ) { notification {seenState} } }
\`;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const { graphql } = require("react-relay");
const Relay = require("react-relay/classic");
graphql\`
mutation MarkReadNotificationMutation($input: MarkReadNotificationData!) {
Expand All @@ -443,14 +433,4 @@ graphql.experimental\`
}
\`;
Relay.QL\`
mutation MarkReadNotificationMutation($input: MarkReadNotificationData!) {
markReadNotification(data: $input) {
notification {
seenState
}
}
}
\`;
`;
9 changes: 0 additions & 9 deletions tests/multiparser_js_graphql/react-relay.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { graphql } = require("react-relay");
const Relay = require("react-relay/classic");

graphql`
mutation MarkReadNotificationMutation(
Expand All @@ -16,11 +15,3 @@ graphql.experimental`
)
{ markReadNotification(data: $input ) { notification {seenState} } }
`;

Relay.QL`
mutation MarkReadNotificationMutation(
$input
: MarkReadNotificationData!
)
{ markReadNotification(data: $input ) { notification {seenState} } }
`;

0 comments on commit cfb8987

Please sign in to comment.