How to find/create external alias source

I’m trying to use syncComponentByExternalAlias to insert a component, since I won’t usually know the local componentId.

I’m attempting to sync using 50 different values for externalSource, but I keep getting this error:

Variable 'externalSource' has an invalid value: Variable 'externalSource' has coerced Null value for NonNull type 'ID!'

I’ve searched around but can’t find any clear examples of how to insert using this method—only updates, and even those are scarce.

I tried creating a Data Provider with the same name as the one I’m passing in, but that didn’t help. The only mutation I can see is unlinkExternalSource, not one to link or create an externalSource, which makes me think I may be missing a step or misunderstanding what externalSource is meant to refer to.

Here’s the payload I’m passing in:

return {
    cloudId: cloudId,
    labels: [type, apiVersion].filter(v => v != null),
    name: name,
    type: CompassComponentType.Library,
    externalAlias: {
        externalId: `${type}/${filename}`,
        externalSource: repository, // This is likely the problem line
        url: url,
    },
};

Does anyone know:

  • What a valid externalSource value looks like?
  • Whether syncComponentByExternalAlias can actually create components from scratch?
  • If there’s a way to “link” an external source before syncing?

Any help would be appreciated!