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

GraphQL: CreateGroup mutation #799

Merged
merged 5 commits into from
Oct 4, 2024
Merged

Conversation

JeffreyThiessen
Copy link
Member

@JeffreyThiessen JeffreyThiessen commented Sep 27, 2024

What does this PR do and why?

Describe in detail what your merge request does and why.
Fixes #787

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. sign in to a user and load GraphiQL
  2. Get information on a group to use as a parent group
query get_groups{
  groups(first:5){
    nodes{
      puid
      id
      name
      fullName
      path
      fullPath
    }
  }
}
  1. Make a group under a parent group using puid
mutation make_group_with_parent_group_puid{
  createGroup(input:{
    name:"my group in a parent group",
    groupPuid:"INXT_GRP_AYJ2V6XLN2"
  }){
    group{
      puid
      id
      name
      fullName
      path
      fullPath
    },
    errors{
      path,
      message
    }
  }
}
  1. Make a group using a parent group id
mutation make_group_with_parent_group_id{
  createGroup(input:{
    name:"my group 2 in a parent group",
    groupId:"gid://irida/Group/31f2ed96-82e1-41fa-82cc-e4b83d4e24bb"
  }){
    group{
      puid
      id
      name
      fullName
      path
      fullPath
    },
    errors{
      path,
      message
    }
  }
}
  1. Try making a group without a parent group, and with a custom path, make sure that the path gets slugified
mutation make_group{
  createGroup(input:{
    name:"my new group",
    description:"my group desc",
    path:"My custom path"
  }){
    group{
      puid
      id
      name
      fullName
      path
      fullPath
    },
    errors{
      path,
      message
    }
  }
}

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

This comment has been minimized.

@JeffreyThiessen JeffreyThiessen marked this pull request as ready for review September 27, 2024 21:45
@JeffreyThiessen JeffreyThiessen added ready for review Pull request is ready for review graphql GraphQL API related changes labels Sep 27, 2024

This comment has been minimized.

ChrisHuynh333
ChrisHuynh333 previously approved these changes Oct 1, 2024
Copy link
Collaborator

@ChrisHuynh333 ChrisHuynh333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

ksierks
ksierks previously approved these changes Oct 1, 2024
Copy link
Contributor

@ksierks ksierks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it matters, but I think we slugify with '-' by default instead of '_'.
Works great!

This comment has been minimized.

ksierks
ksierks previously approved these changes Oct 2, 2024
Copy link
Member

@ericenns ericenns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, just a few comments on processing path argument.

app/graphql/mutations/create_group.rb Outdated Show resolved Hide resolved
test/graphql/create_group_mutation_test.rb Outdated Show resolved Hide resolved

This comment has been minimized.

@JeffreyThiessen JeffreyThiessen self-assigned this Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

Code Metrics Report

Coverage Test Execution Time
93.4% 7m57s

Code coverage of files in pull request scope (100.0%)

Files Coverage
app/graphql/mutations/create_group.rb 100.0%
app/graphql/types/mutation_type.rb 100.0%

Reported by octocov

Copy link
Member

@ericenns ericenns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@ericenns ericenns merged commit 631c2ba into main Oct 4, 2024
3 checks passed
@ericenns ericenns deleted the graphql/create_group_mutation branch October 4, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graphql GraphQL API related changes ready for review Pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL: createGroup mutation
4 participants