Add `graphql.experimental` parsing for react-relay (#2116)
parent
4cf94c95c7
commit
44b5da8ade
|
@ -94,6 +94,7 @@ function fromBabylonFlowOrTypeScript(path) {
|
|||
/*
|
||||
* react-relay and graphql-tag
|
||||
* graphql`...`
|
||||
* graphql.experimental`...`
|
||||
* gql`...`
|
||||
*/
|
||||
if (
|
||||
|
@ -103,9 +104,12 @@ function fromBabylonFlowOrTypeScript(path) {
|
|||
// ((parentParent.tag.type === "MemberExpression" &&
|
||||
// parentParent.tag.object.name === "Relay" &&
|
||||
// parentParent.tag.property.name === "QL") ||
|
||||
(parentParent.tag.type === "Identifier" &&
|
||||
(parentParent.tag.name === "gql" ||
|
||||
parentParent.tag.name === "graphql"))
|
||||
((parentParent.tag.type === "MemberExpression" &&
|
||||
parentParent.tag.object.name === "graphql" &&
|
||||
parentParent.tag.property.name === "experimental") ||
|
||||
(parentParent.tag.type === "Identifier" &&
|
||||
(parentParent.tag.name === "gql" ||
|
||||
parentParent.tag.name === "graphql")))
|
||||
) {
|
||||
return {
|
||||
options: { parser: "graphql" },
|
||||
|
|
|
@ -36,6 +36,14 @@ graphql\`
|
|||
)
|
||||
{ markReadNotification(data: $input ) { notification {seenState} } }
|
||||
\`;
|
||||
|
||||
graphql.experimental\`
|
||||
mutation MarkReadNotificationMutation(
|
||||
$input
|
||||
: MarkReadNotificationData!
|
||||
)
|
||||
{ markReadNotification(data: $input ) { notification {seenState} } }
|
||||
\`;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
const { graphql } = require("react-relay");
|
||||
|
||||
|
@ -49,4 +57,14 @@ graphql\`
|
|||
}
|
||||
\`;
|
||||
|
||||
graphql.experimental\`
|
||||
mutation MarkReadNotificationMutation($input: MarkReadNotificationData!) {
|
||||
markReadNotification(data: $input) {
|
||||
notification {
|
||||
seenState
|
||||
}
|
||||
}
|
||||
}
|
||||
\`;
|
||||
|
||||
`;
|
||||
|
|
|
@ -7,3 +7,11 @@ graphql`
|
|||
)
|
||||
{ markReadNotification(data: $input ) { notification {seenState} } }
|
||||
`;
|
||||
|
||||
graphql.experimental`
|
||||
mutation MarkReadNotificationMutation(
|
||||
$input
|
||||
: MarkReadNotificationData!
|
||||
)
|
||||
{ markReadNotification(data: $input ) { notification {seenState} } }
|
||||
`;
|
||||
|
|
Loading…
Reference in New Issue