mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
44 lines
833 B
TypeScript
44 lines
833 B
TypeScript
import * as React from "react"
|
|
import * as Relay from "react-relay"
|
|
|
|
interface Props {
|
|
text: string
|
|
userId: string
|
|
}
|
|
|
|
interface Response {
|
|
}
|
|
|
|
export default class AddTweetMutation extends Relay.Mutation<Props, Response> {
|
|
|
|
getMutation () {
|
|
return Relay.QL`mutation{addTweet}`
|
|
}
|
|
|
|
getFatQuery () {
|
|
return Relay.QL`
|
|
fragment on AddTweetPayload {
|
|
tweetEdge
|
|
user
|
|
}
|
|
`
|
|
}
|
|
|
|
getConfigs () {
|
|
return [{
|
|
type: "RANGE_ADD",
|
|
parentName: "user",
|
|
parentID: this.props.userId,
|
|
connectionName: "tweets",
|
|
edgeName: "tweetEdge",
|
|
rangeBehaviors: {
|
|
"": "append",
|
|
},
|
|
}]
|
|
}
|
|
|
|
getVariables () {
|
|
return this.props
|
|
}
|
|
}
|