Last active
February 24, 2016 16:58
-
-
Save sfroestl/3da1663ff4d779a99a63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Relay from 'generic-relay'; | |
export default class AttendConferenceMutation extends Relay.Mutation { | |
/* ... */ | |
getFatQuery() { | |
return Relay.QL` | |
fragment on AttendConferencePayload { | |
conference { | |
attendance, | |
userIsAttending | |
}, | |
user { | |
attendingConferences | |
}, | |
conferenceEdge { | |
node | |
} | |
} | |
`; | |
} | |
getConfigs() { | |
return [{ | |
type: 'FIELDS_CHANGE', | |
fieldIDs: { conference: this.props.conference.id }, | |
}, { | |
type: 'RANGE_ADD', | |
parentName: 'user', | |
parentID: this.props.user.id, | |
connectionName: 'attendingConferences', | |
edgeName: 'conferenceEdge', | |
rangeBehaviors: { | |
'': 'append', | |
}, | |
}]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment