File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -215,6 +215,34 @@ module.exports = {
215215 }
216216 } ,
217217
218+ /**
219+ * Remove project rate limits settings
220+ *
221+ * @param {ResolverObj } _obj
222+ * @param {string } id - project id
223+ * @param {UserInContext } user - current authorized user {@see ../index.js}
224+ * @param {ContextFactories } factories - factories for working with models
225+ *
226+ * @returns {Project }
227+ */
228+ async removeProjectRateLimits ( _obj , { id } , { user, factories } ) {
229+ const project = await factories . projectsFactory . findById ( id ) ;
230+
231+ if ( ! project ) {
232+ throw new ApolloError ( 'There is no project with that id' ) ;
233+ }
234+
235+ if ( project . workspaceId . toString ( ) === '6213b6a01e6281087467cc7a' ) {
236+ throw new ApolloError ( 'Unable to update demo project' ) ;
237+ }
238+
239+ try {
240+ return project . updateProject ( null , { rateLimitSettings : '' } ) ;
241+ } catch ( err ) {
242+ throw new ApolloError ( 'Something went wrong' ) ;
243+ }
244+ } ,
245+
218246 /**
219247 * Generates new project integration token by id
220248 *
Original file line number Diff line number Diff line change @@ -361,6 +361,16 @@ extend type Mutation {
361361 rateLimitSettings: RateLimitSettingsInput!
362362 ): Project! @requireAdmin
363363
364+ """
365+ Remove project rate limits settings
366+ """
367+ removeProjectRateLimits(
368+ """
369+ What project to update
370+ """
371+ id: ID!
372+ ): Project! @requireAdmin
373+
364374 """
365375 Generates new project integration token by id
366376 """
You can’t perform that action at this time.
0 commit comments