From ac8e47ac2d59f25e7054e8f4dba0e9557df82c74 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 13 Jul 2022 17:21:41 +1200 Subject: [PATCH] Lint --- app/controllers/api/graphql.php | 6 +++--- src/Appwrite/GraphQL/Builder.php | 6 ++++-- tests/e2e/Services/GraphQL/GraphQLContentTypeTest.php | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 28f546c2a8..ccf4ac324a 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -100,7 +100,7 @@ function graphqlRequest( if (empty($query)) { throw new Exception('No query supplied.', 400, Exception::GRAPHQL_NO_QUERY); } - + $maxComplexity = App::getEnv('_APP_GRAPHQL_MAX_QUERY_COMPLEXITY', 200); $maxDepth = App::getEnv('_APP_GRAPHQL_MAX_QUERY_DEPTH', 3); @@ -114,9 +114,9 @@ function graphqlRequest( } else { $debugFlags = DebugFlag::NONE; } - + $promises = []; - foreach($query as $indexed) { + foreach ($query as $indexed) { $promises[] = GraphQL::promiseToExecute( $promiseAdapter, $gqlSchema, diff --git a/src/Appwrite/GraphQL/Builder.php b/src/Appwrite/GraphQL/Builder.php index d80beda962..89699de83d 100644 --- a/src/Appwrite/GraphQL/Builder.php +++ b/src/Appwrite/GraphQL/Builder.php @@ -300,9 +300,11 @@ class Builder $collectionSchemaDirty = $register->has('schemaDirty') && $register->get('schemaDirty'); $apiSchemaDirty = \version_compare($envVersion, $schemaVersion, "!="); - if (!$collectionSchemaDirty + if ( + !$collectionSchemaDirty && !$apiSchemaDirty - && $register->has('fullSchema')) { + && $register->has('fullSchema') + ) { $timeElapsedMillis = (microtime(true) - $start) * 1000; $timeElapsedMillis = \number_format((float) $timeElapsedMillis, 3, '.', ''); Console::info('[INFO] Fetched GraphQL Schema in ' . $timeElapsedMillis . 'ms'); diff --git a/tests/e2e/Services/GraphQL/GraphQLContentTypeTest.php b/tests/e2e/Services/GraphQL/GraphQLContentTypeTest.php index 897e096757..f718586036 100644 --- a/tests/e2e/Services/GraphQL/GraphQLContentTypeTest.php +++ b/tests/e2e/Services/GraphQL/GraphQLContentTypeTest.php @@ -87,9 +87,9 @@ class GraphQLContentTypeTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $gqlPayload); - + $bucket = $bucket['body']['data']['storageCreateBucket']; - + $query = $this->getQuery(self::$CREATE_FILE); $gqlPayload = [ 'operations' => \json_encode([ @@ -118,4 +118,4 @@ class GraphQLContentTypeTest extends Scope $this->assertArrayNotHasKey('errors', $file['body']); $this->assertIsArray($file['body']['data']['storageCreateFile']); } -} \ No newline at end of file +}