Hi Igor,
I think that using reflection is possible to build a graphQL model starting from DbContenxt (for example using entity framework like ORM). Our solution starts fetching model from _schema collection and translates result on GraphQL model.
GraphQLQuery is the class that builds a model, you can change this class with something like this:
'''
public GraphQLQuery(DbContext ctx)
{
Name = "Query";
//Create exstencion to dbcontext that list all registred entity like Type
//key should be you entity descriptor
foreach (var key in ctx.Entities)
{
//CollectionType is the class that build GraphQL model from entity Type
//Inside this class use reflection for map entity property type to GraphQL type
CollectionType type = new CollectionType(key, ctx.Entities, graphQLService);
ListGraphType listType = new ListGraphType(type);
AddField(new FieldType
{
Name = metaColl.CollectionName,
Type = listType.GetType(),
ResolvedType = listType,
Resolver = new JObjectFieldResolver(graphQLService),
Arguments = new QueryArguments(
type.TableArgs
)
});
}
}
'''
Then it is necessary to change JObjectFieldResolver, in this class the GraphQL query is translated to entity query, you should change BuildMongoQuery method and build linq query for your HORM (this query is sent to CRUD service, for simplicity I think that you can execute query directly here).
Now you should change the NameFieldResolver, this class retrieve the value from property name, you can use something like this
src.GetType().GetProperty(propName).GetValue(src)
Our implementation work with JObject for simplicity, but I think that you can work with object like abstract class
I hope I explained myself in some way :-)
<v-spacer></v-spacer>
, check this StackOverflow question: https://stackoverflow.com/questions/56905360/center-v-toolbar-title