Skip to content

Commit

Permalink
Add internal docs for exported behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
stocaaro committed Oct 10, 2024
1 parent b0073d2 commit adcc3f9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/appsync-modelgen-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import { AppSyncModelDartVisitor } from './visitors/appsync-dart-visitor';
import { AppSyncModelIntrospectionVisitor } from './visitors/appsync-model-introspection-visitor';
import { SyncTypes } from './types/sync';

/**
* @internal
*/
export const pluginSync: SyncTypes.PluginFunction<RawAppSyncModelConfig> = (
schema: GraphQLSchema,
rawDocuments: Types.DocumentFile[],
Expand Down
3 changes: 3 additions & 0 deletions packages/appsync-modelgen-plugin/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ const buildGenerations = (options: PresetFnArgs): GenerateOptions[] => {
}
};

/**
* @internal
*/
export const presetSync: SyncTypes.OutputPreset<AppSyncModelCodeGenPresetConfig> = {
buildGeneratesSection: (options: SyncTypes.PresetFnArgs<AppSyncModelCodeGenPresetConfig>): SyncTypes.GenerateOptions[] => {
const {cache, pluginMap, ...otherOptions} = options;
Expand Down
3 changes: 3 additions & 0 deletions packages/appsync-modelgen-plugin/src/types/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export type SyncCache<Obj extends CacheContainer> = Omit<Obj, 'cache'> & {
cache?: (<T>(namespace: string, key: string, factory: () => T) => T) | undefined
};

/**
* @internal
*/
export declare namespace SyncTypes {
type GenerateOptions = SyncCache<SyncPluginMap<Types.GenerateOptions>>;

Expand Down
3 changes: 3 additions & 0 deletions packages/graphql-generator/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export async function generateModels(options: GenerateModelsOptions): Promise<Ge
).then((outputs: GeneratedOutput[]) => outputs.reduce((curr, next) => ({ ...curr, ...next }), {}));
}

/**
* @internal
*/
export function generateModelsSync(options: GenerateModelsOptions): GeneratedOutput {
const appsyncLocalConfig = appSyncDataStoreCodeGen.presetSync.buildGeneratesSection({
...mapBuilderOptions(options),
Expand Down

0 comments on commit adcc3f9

Please sign in to comment.