The short answer is no for OOTB. GraphQL is based on a schema.
Your GraphQL server uses a schema to describe the shape of your data
graph. This schema defines a hierarchy of types with fields that are
populated from your back-end data stores. The schema also specifies
exactly which queries and mutations are available for clients to
execute against your data graph.
So, even if you have a custom implementation of your GraphQL query, you will need to specify the mapping of your graph types. See example below:
The above query will get its values via backend code. Below is a pseudo code how the process works internally
Get Item name using Sitecore APIs and assign it to the field string graph type
Field<StringGraphType>("name", null, null, x => x.Source.ItemName);
For the fields, it will loops through all the fields available on the items and you can specify whether to include the standard fields. A list will be obtained and it will get populated as follows
Field<ListGraphType<ItemFieldInterfaceGraphType>>("fields", null, null, x => x.Source.FieldCollections);
Please note that the above is not how it is implemented in Sitecore but it gives an overview on how it looks. You can get more information on the implementation by looking at the Sitecore dll
Sitecore.Services.GraphQL.Content.dll. The namespace for the item query is
You can still perform your proposed scenario but you will need to create a new query and then have the graph type implementation as dynamic. So, the name property in the graph type will be dynamic. However, you may end up having lots of issues since you will need to know the schema so that the returned result is mapped to the schema.
For example, all developers knows the different properties that a Sitecore field has (name, value) but if you write down the code to be like "fieldNameHere": "fieldValueHere", it will cause some errors because you may end up specifying a field name which does not exist.