Fix typo in graphql error (#4792)

This commit is contained in:
Raphael Darley 2024-09-17 13:02:27 +01:00 committed by GitHub
parent efb7000583
commit 3531435d15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -82,8 +82,8 @@ impl<I: Invalidator> SchemaCache<I> {
}
}
pub async fn get_schema(&self, session: &Session) -> Result<Schema, GqlError> {
let ns = session.ns.as_ref().ok_or(GqlError::UnpecifiedNamespace)?;
let db = session.db.as_ref().ok_or(GqlError::UnpecifiedDatabase)?;
let ns = session.ns.as_ref().ok_or(GqlError::UnspecifiedNamespace)?;
let db = session.db.as_ref().ok_or(GqlError::UnspecifiedDatabase)?;
{
let guard = self.inner.read().await;
if let Some(cand) = guard.get(&(ns.to_owned(), db.to_owned())) {

View file

@ -14,9 +14,9 @@ pub enum GqlError {
#[error("Error resolving request: {0}")]
ResolverError(String),
#[error("No Namespace specified")]
UnpecifiedNamespace,
UnspecifiedNamespace,
#[error("No Database specified")]
UnpecifiedDatabase,
UnspecifiedDatabase,
#[error("GraphQL has not been configured for this database")]
NotConfigured,
#[error("Internal Error: {0}")]

View file

@ -84,8 +84,8 @@ pub async fn generate_schema(
) -> Result<Schema, GqlError> {
let kvs = datastore;
let tx = kvs.transaction(TransactionType::Read, LockType::Optimistic).await?;
let ns = session.ns.as_ref().ok_or(GqlError::UnpecifiedNamespace)?;
let db = session.db.as_ref().ok_or(GqlError::UnpecifiedDatabase)?;
let ns = session.ns.as_ref().ok_or(GqlError::UnspecifiedNamespace)?;
let db = session.db.as_ref().ok_or(GqlError::UnspecifiedDatabase)?;
let cg = tx.get_db_config(ns, db, "graphql").await.map_err(|e| match e {
crate::err::Error::CgNotFound {