ExposeFieldColumns
Specifies how the provider exposes GraphQL fields with arguments as SQL columns and argument pseudocolumns.
Possible Values
ARGUMENTLESS, OPTIONAL_ARGUMENTS_EXCLUDED, OPTIONAL_ARGUMENTS_INCLUDED, ALLData Type
string
Default Value
"ARGUMENTLESS"
Remarks
Arguments on a returned field modify that field's value; they do not filter rows in the parent table. For example,
avatar(size: 100)changes the value returned by
avatar.
An object field can be exposed both as a table and as flattened columns on its parent table. This property controls the flattened-column representation. The ExposeObjectTables property independently controls the table representation, where the object's arguments are exposed as table filters.
This property offers four modes:
- ARGUMENTLESS: Only fields without arguments are exposed as columns. This is the default.
- OPTIONAL_ARGUMENTS_EXCLUDED: Fields are also exposed when all of their arguments can be omitted. No argument pseudocolumns are created, and the field is requested without arguments so that the server applies its normal argument-free behavior and any declared defaults.
- OPTIONAL_ARGUMENTS_INCLUDED: Exposes the same fields as OPTIONAL_ARGUMENTS_EXCLUDED and also creates argument pseudocolumns. Values supplied for these pseudocolumns in the WHERE clause are passed to the field in the GraphQL query.
- ALL: Also exposes fields that have required arguments and creates argument pseudocolumns for them. When one of these fields is selected, including through
SELECT *
, the WHERE clause must supply a valid argument path containing its required values. Otherwise, the add-in raises an error.
In OPTIONAL_ARGUMENTS_INCLUDED and ALL modes, primitive arguments become pseudocolumns on the field's parent table. Arguments of an input object type are flattened into pseudocolumns for their primitive fields, according to the ExpandArgumentsDepth setting. The add-in also enforces any
oneOfinput-object restrictions.
Use
PseudoColumns="*=*"to make the argument pseudocolumns visible. These pseudocolumns are query modifiers rather than row filters: values supplied in the WHERE clause are inserted at the owning field's path in the GraphQL query.
Argument pseudocolumns are named using the flattened owning field path, followed by
_arg_, followed by the flattened argument input path. For example, the
currencyargument of
localizedPriceis named
localizedPrice_arg_currency. If that name conflicts with another SQL column, a numeric suffix is added to make it unique.
Example
Consider this GraphQL schema:
type Query {
users: [User]
}
type User {
id: ID!
name: String!
avatar(size: Int): String
}
With OPTIONAL_ARGUMENTS_EXCLUDED or higher, the
avatarfield is exposed as a column on the
Userstable. In OPTIONAL_ARGUMENTS_EXCLUDED mode, the GraphQL query requests
avatarwithout the
sizeargument.
With OPTIONAL_ARGUMENTS_INCLUDED or ALL, an
avatar_arg_sizepseudocolumn is also created. For example, the following query requests
avatar(size: 100):
SELECT name, avatar FROM Users WHERE avatar_arg_size = 100