If you store the namespaces in the database then you don't need the explicit directive and you can use prefixes like
foaf_ directly in your queries. Otherwise there is no option to separate directives from queries.
The next release will also introduce a new schema directive that will let you define the namespaces at the GraphQL schema level so they don't have to be repeated in queries and you can use filed names without the namespace prefixes.
As a side note, there is a GraphQL example in the examples repo but the example only uses the default namespace so not relevant here,