Skip to content

[Step2|BE] Add new blob type input in snippet create mutation

After adding the new blob type in #217789 (closed), we need to include it in the snippet create mutation https://gitlab.com/gitlab-org/gitlab/blob/master/app/graphql/mutations/snippets/create.rb.

Therefore, once we add this field we can create the snippet blob, by using file_name and content or the new type.

The new type definition in the mutation will be something like:

argument :files, [Types::Snippets::BlobInputType], 
                 description: "The snippet blobs to create"
                 required: true

When we pass the files attribute to the Snippets::CreateService we need to ensure that we translate it to snippet_files, because the files attribute is used for different things in the service.

Edited by Francisco Javier López