Fix typo in graphql error (#4792)
This commit is contained in:
parent
efb7000583
commit
3531435d15
3 changed files with 6 additions and 6 deletions
|
@ -82,8 +82,8 @@ impl<I: Invalidator> SchemaCache<I> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub async fn get_schema(&self, session: &Session) -> Result<Schema, GqlError> {
|
pub async fn get_schema(&self, session: &Session) -> Result<Schema, GqlError> {
|
||||||
let ns = session.ns.as_ref().ok_or(GqlError::UnpecifiedNamespace)?;
|
let ns = session.ns.as_ref().ok_or(GqlError::UnspecifiedNamespace)?;
|
||||||
let db = session.db.as_ref().ok_or(GqlError::UnpecifiedDatabase)?;
|
let db = session.db.as_ref().ok_or(GqlError::UnspecifiedDatabase)?;
|
||||||
{
|
{
|
||||||
let guard = self.inner.read().await;
|
let guard = self.inner.read().await;
|
||||||
if let Some(cand) = guard.get(&(ns.to_owned(), db.to_owned())) {
|
if let Some(cand) = guard.get(&(ns.to_owned(), db.to_owned())) {
|
||||||
|
|
|
@ -14,9 +14,9 @@ pub enum GqlError {
|
||||||
#[error("Error resolving request: {0}")]
|
#[error("Error resolving request: {0}")]
|
||||||
ResolverError(String),
|
ResolverError(String),
|
||||||
#[error("No Namespace specified")]
|
#[error("No Namespace specified")]
|
||||||
UnpecifiedNamespace,
|
UnspecifiedNamespace,
|
||||||
#[error("No Database specified")]
|
#[error("No Database specified")]
|
||||||
UnpecifiedDatabase,
|
UnspecifiedDatabase,
|
||||||
#[error("GraphQL has not been configured for this database")]
|
#[error("GraphQL has not been configured for this database")]
|
||||||
NotConfigured,
|
NotConfigured,
|
||||||
#[error("Internal Error: {0}")]
|
#[error("Internal Error: {0}")]
|
||||||
|
|
|
@ -84,8 +84,8 @@ pub async fn generate_schema(
|
||||||
) -> Result<Schema, GqlError> {
|
) -> Result<Schema, GqlError> {
|
||||||
let kvs = datastore;
|
let kvs = datastore;
|
||||||
let tx = kvs.transaction(TransactionType::Read, LockType::Optimistic).await?;
|
let tx = kvs.transaction(TransactionType::Read, LockType::Optimistic).await?;
|
||||||
let ns = session.ns.as_ref().ok_or(GqlError::UnpecifiedNamespace)?;
|
let ns = session.ns.as_ref().ok_or(GqlError::UnspecifiedNamespace)?;
|
||||||
let db = session.db.as_ref().ok_or(GqlError::UnpecifiedDatabase)?;
|
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 {
|
let cg = tx.get_db_config(ns, db, "graphql").await.map_err(|e| match e {
|
||||||
crate::err::Error::CgNotFound {
|
crate::err::Error::CgNotFound {
|
||||||
|
|
Loading…
Reference in a new issue