Skip to content

@pothos/plugin-with-input@3.10.0

Compare
Choose a tag to compare
@github-actions github-actions released this 07 Jan 03:17
· 641 commits to main since this release
f7fe143

Minor Changes

  • 3776481: Add name option to typeOptions of@pothos/plugin-with-input to customize the
    default naming of input fields.

    An example usage of this:

    import WithInputPlugin from '@pothos/plugin-with-input';
    const builder = new SchemaBuilder({
      plugins: [WithInputPlugin],
      withInput: {
        typeOptions: {
          name: ({ parentTypeName, fieldName }) => {
            const capitalizedFieldName = `${fieldName[0].toUpperCase()}${fieldName.slice(1)}`;
            // This will remove the default Query/Mutation prefix from the input type name
            if (parentTypeName === 'Query' || parentTypeName === 'Mutation') {
              return `${capitalizedFieldName}Input`;
            }
    
            return `${parentTypeName}${capitalizedFieldName}Input`;
          },
        },
      },
    });