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

Generated migration scripts does not contain the necessary parameters for Contentful:GraphQLFieldResolver annotation id #2576

Open
fcasibu opened this issue Feb 7, 2024 · 0 comments

Comments

@fcasibu
Copy link

fcasibu commented Feb 7, 2024

Expected Behavior

With the Commercetools app, fields that uses the annotation for "Resolve content on delivery" Contentful:GraphQLFieldResolver should also set the parameters when creating a migration script.

e.g.

module.exports = function (migration) {
  const annotatedContentType = migration.editContentType('annotated')
  annotatedContentType.editField('title').setAnnotations(['Contentful:GraphQLFieldResolver'], {
    parameters: {
      appFunctionId: '123',
      appDefinitionId: '456'
    }
  })
}

Actual Behavior

It only generates this without the second parameter:

e.g.

annotatedContentType.editField('title').setAnnotations(['Contentful:GraphQLFieldResolver'])

Without it, it'll throw an error with the following message: Invalid annotation assignment. Annotation requires parameters

Possible Solution

After some digging, a Content Type contains a metadata.annotations that has the necessary values for appFunctionId and appDefinitionId. Is it possible to use this or something that is potentially easier behind the scenes when generating a script?

Steps to Reproduce

  1. Most of the process is already in: https://www.contentful.com/help/commercetools/#usage
  2. Generate the migration script with contentful merge export

Context

Environment

  • Language Version: v18.17.0
  • Package Manager Version: 9.6.7
  • Browser Version: n/a
  • Operating System: macOS Ventura 13.2.1
  • Package Version: 3.1.41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant