Closed bdelacretaz closed 3 years ago
For the constructor I suggest
new AEMHeadless(<graphql_endpoint: String>)
As a the minimal version with just the endpoint config (assuming that's useful, without credentials?) and
new AEMHeadless(<config object>)
when the client needs more parameters.
The config object might be
{
serviceURL: <the URL of the AEM server>,
credentials: {
username: ...
password: ...
},
authToken: ...
}
Where either credentials
or the authToken
are specified.
What do people think?
I suggest the following method names:
* runQuery(stmt) -> executes a query based on a GraphQL query statement
* runPersistedQuery(path) -> executes a persisted query based on its path
* persistQuery(path, stmt) -> saves a persisted query at the given path
* listQueries() -> list all persisted queries. Assuming that's reasonable and the result can be streamed, or there's a limit on how many results are returned.
What do people think?
Note that the next release should have a major release number as we're changing the API. At this early stage I don't think that's a problem.
I'm just wondering if listQueries()
should be listPersistedQueries()
to align with runPersistedQuery()
Besides this, I'm +1
Fair enough - let's make it
* runQuery(stmt) -> executes a query based on a GraphQL query statement
* runPersistedQuery(path) -> executes a persisted query based on its path
* persistQuery(path, stmt) -> saves a persisted query at the given path
* listPersistedQueries() -> list all persisted queries
then
We'd like to review the constructor style and probably move to a ctor(config object) style, and the method names could be more explicit.
This goes together with https://github.com/adobe/aem-headless-client-java/issues/2 which is the same thing for the Java client.