This section describes introspection of scalar types.
Introspection of the schema::ScalarType
:
db> ... ... ... ... ... ... ... ... ... ...
WITH MODULE schema
SELECT ObjectType {
name,
links: {
name,
},
properties: {
name,
}
}
FILTER .name = 'schema::ScalarType';
{ Object { name: 'schema::ScalarType', links: { Object { name: '__type__' }, Object { name: 'annotations' }, Object { name: 'bases' }, Object { name: 'constraints' }, Object { name: 'ancestors' } }, properties: { Object { name: 'default' }, Object { name: 'enum_values' }, Object { name: 'id' }, Object { name: 'abstract' }, Object { name: 'final' }, Object { name: 'name' } } } }
Introspection of the built-in scalar str
:
db> ... ... ... ... ... ... ... ... ... ... ... ...
WITH MODULE schema
SELECT ScalarType {
name,
default,
enum_values,
abstract,
final,
bases: { name },
ancestors: { name },
annotations: { name, @value },
constraints: { name },
}
FILTER .name = 'std::str';
{ Object { name: 'std::str', default: {}, enum_values: {}, abstract: {}, final: {}, bases: {Object { name: 'std::anyscalar' }}, ancestors: {Object { name: 'std::anyscalar' }}, annotations: {}, constraints: {} } }
For an enumerated scalar type, consider the following:
scalar type Color extending enum<Red, Green, Blue>;
Introspection of the enum scalar Color
:
db> ... ... ... ... ... ... ... ... ... ... ... ...
WITH MODULE schema
SELECT ScalarType {
name,
default,
enum_values,
abstract,
final,
bases: { name },
ancestors: { name },
annotations: { name, @value },
constraints: { name },
}
FILTER .name = 'default::Color';
{ Object { name: 'default::Color', default: {}, enum_values: ['Red', 'Green', 'Blue'], abstract: {}, final: true, bases: {Object { name: 'std::anyenum' }}, ancestors: { Object { name: 'std::anyscalar' }, Object { name: 'std::anyenum' } }, annotations: {}, constraints: {} } }