Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
};
export const postGraphileClassicIdsOverrides = {
column(name: string, _table: string, _schema?: string) {
return name === "id" ? "rowId" : inflections.defaultUtils.camelCase(name);
},
};
export const postGraphileInflection = inflections.newInflector(
// @ts-ignore
postGraphileBaseOverrides
);
// @ts-ignore
export const postGraphileClassicIdsInflection = inflections.newInflector({
...postGraphileBaseOverrides,
...postGraphileClassicIdsOverrides,
});
/*
* ABOVE HERE IS DEPRECATED.
*/
export const PostGraphileInflectionPlugin = function(builder: SchemaBuilder) {
builder.hook("inflection", (inflection: Inflection) => {
const previous = inflection.enumName;
// Overwrite directly so that we don't lose the 'extend' hints
Object.assign(inflection, {
enumName(value: string) {
return this.constantCase(previous.call(this, value));
},
});
export const postGraphileBaseOverrides = {
enumName(value: string) {
return inflections.defaultUtils.constantCase(
inflections.defaultInflection.enumName(value)
);
},
};
export const postGraphileClassicIdsOverrides = {
column(name: string, _table: string, _schema?: string) {
return name === "id" ? "rowId" : inflections.defaultUtils.camelCase(name);
},
};
export const postGraphileInflection = inflections.newInflector(
// @ts-ignore
postGraphileBaseOverrides
);
// @ts-ignore
export const postGraphileClassicIdsInflection = inflections.newInflector({
...postGraphileBaseOverrides,
...postGraphileClassicIdsOverrides,
});
/*
* ABOVE HERE IS DEPRECATED.
*/
export const PostGraphileInflectionPlugin = function(builder: SchemaBuilder) {
builder.hook("inflection", (inflection: Inflection) => {
const previous = inflection.enumName;