Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added Delete Beacon mutation #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions graphql/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ const resolvers = {
return beacon;
},

deleteBeacon: async (_, {beaconID}) =>{
return await Beacon.findByIdAndRemove(beaconID);
},

joinBeacon: async (_, { shortcode }, { user, pubsub }) => {
const beacon = await Beacon.findOne({ shortcode });

Expand Down
1 change: 1 addition & 0 deletions graphql/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const typeDefs = gql`
if start time not supplied, default is Date.now
"""
createBeacon(beacon: BeaconInput): Beacon!
deleteBeacon(beaconID: ID!): Beacon!
createLandmark(landmark: LandmarkInput, beaconID: ID!): Landmark!
register(user: RegistrationInput): User!
"""
Expand Down