Closed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
If a change is made to a ParseGraphQLConfiguration
using setGraphQLConfig()
, and then the change is removed, the original (default) ParseGraphQLConfiguration
does not return automatically. It must be reset by the developer.
Steps to reproduce
- Create a Parse Server instance and add a custom
graphQLConfig
similar to the example below. - Note that the GraphQL Playground Docs tab shows that the
get
andfind
query aliases for theItem
class are in use. - Remove the custom
graphQLConfig
related code from the Parse Server instance and refresh the GraphQL Playground page. - Note that the GraphQL Playground Docs tab continues to show that the
get
andfind
query aliases for theItem
class are in use. - Instead of removing the
graphQLConfig
related code as mentioned in step#3
, change it to this (forces a reset of the previously-changed configuration settings):
const graphQLConfig = {
classConfigs: [],
};
- Note that the GraphQL Playground Docs tab now show that the
get
andfind
queries for theItem
class has returned to the defaultitem
anditems
query names, respectively.
Parse Server Instance Example:
const parseServer = new ParseServer({
databaseURI: 'mongodb://localhost:27017/test',
appId: 'APPLICATION_ID',
masterKey: 'MASTER_KEY',
serverURL: 'http://localhost:1337/parse',
});
const parseGraphQLServer = new ParseGraphQLServer(
parseServer,
{
graphQLPath: '/graphql',
playgroundPath: '/playground'
},
);
const graphQLConfig = {
classConfigs: [
{
className: 'Item',
query: {
getAlias: 'getItem',
findAlias: 'findItems',
},
},
],
};
const setParseGraphQLConfig = async () => {
await parseGraphQLServer.setGraphQLConfig(graphQLConfig);
};
setParseGraphQLConfig();
app.use('/parse', parseServer.app);
parseGraphQLServer.applyGraphQL(app);
Actual Outcome
The graphQLConfig
settings do not automatically return to their default settings after removing custom changes.
Expected Outcome
The graphQLConfig
settings should revert to their default settings automatically if no custom changes are applied.
Environment
Server
- Parse Server version:
4.3.0
- Operating system:
Windows 10
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
localhost
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
4.2.8
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
MongoDB Atlas
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
GraphQL
- SDK version:
N/A