Code Monkey home page Code Monkey logo

Comments (13)

kjmartens avatar kjmartens commented on August 16, 2024 1

@denisyilmaz @stephanedemotte We've added support for native Element query arguments such as these to Calendar GraphQL now, but I don't think site is working just yet. We'll continue to work on figuring out why it isn't working.

from craft-calendar.

kjmartens avatar kjmartens commented on August 16, 2024 1

@stephanedemotte I just checked with our developer, and there was a bit of a misunderstanding. site should now work in the latest dev-master branch if you want to check it out, but doing something specifically like site: ["*"] (asterisk) currently does not work - that's what we have to look into. You should be able to do site: "en" or site: ["en", "nl"] though.

We'll release this officially sometime this week (with or without the support for *). Sorry for the confusion.

from craft-calendar.

denisyilmaz avatar denisyilmaz commented on August 16, 2024

could someone help me out here?

from craft-calendar.

kjmartens avatar kjmartens commented on August 16, 2024

Hi @denisyilmaz. From my understanding, we just extended support from what Craft offers for GraphQL implementations. This might be something else we have to manually add support for. I've made a note about it and we'll check into it soon. :)

from craft-calendar.

denisyilmaz avatar denisyilmaz commented on August 16, 2024

Hi @kjmartens thanks for the response. Hope adding a Filter by Site-ID is easy to implement on your side. But good to know this is actually a missing piece for GraphQL support and not somewhere hidden in the docs. Because I was getting crazy finding a solution to get the translated event via GraphQL.

from craft-calendar.

stephanedemotte avatar stephanedemotte commented on August 16, 2024

Big issue here, site should be supported,

{
  solspace_calendar(site: "en") {
    event {
      title
    }
  }
}

Should be the way ?

We need this feature on our side too. +1

from craft-calendar.

stephanedemotte avatar stephanedemotte commented on August 16, 2024

Any news on that ? a lot of craft website use multisite, its an important feature no ?
Thanks !

from craft-calendar.

stephanedemotte avatar stephanedemotte commented on August 16, 2024

You rock thank !

from craft-calendar.

denisyilmaz avatar denisyilmaz commented on August 16, 2024

@kjmartens until now the update was not released yet, right? can you give an update when to expect this?

from craft-calendar.

denisyilmaz avatar denisyilmaz commented on August 16, 2024

And one additional question: will the querying work for siteId as well?

{
  solspace_calendar {
    events(siteId: [1]) {
      id
    }
  }
}

from craft-calendar.

kjmartens avatar kjmartens commented on August 16, 2024

@denisyilmaz Sorry for the delay... this update was not yet released. We'll do that tomorrow for sure. Sorry about that. It should work with siteId as well. :)

from craft-calendar.

kjmartens avatar kjmartens commented on August 16, 2024

Calendar 3.3.4 is now available.

from craft-calendar.

denisyilmaz avatar denisyilmaz commented on August 16, 2024

siteId is working great. One limitation is just found is that I'm not able to retrieve all calendar events in all languages in the same query:

Query

{
  solspace_calendar {
    events(site: ["*"], loadOccurrences: false) {
      id
      url
      title
    }
  }
}

Error

{
  "errors": [
    {
      "debugMessage": "Invalid site param: [*]",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "trace": [
        {
          "file": "/var/www/html/vendor/symfony/property-access/PropertyAccessor.php",
          "line": 580,
          "call": "craft\\elements\\db\\ElementQuery::site(array(1))"
        },
        {
          "file": "/var/www/html/vendor/symfony/property-access/PropertyAccessor.php",
          "line": 175,
          "call": "Symfony\\Component\\PropertyAccess\\PropertyAccessor::writeProperty(array(1), 'site', array(1))"
        },
        {
          "file": "/var/www/html/vendor/solspace/craft3-calendar/packages/plugin/src/Elements/Event.php",
          "line": 227,
          "call": "Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue(instance of Solspace\\Calendar\\Elements\\Db\\EventQuery(21), 'site', array(1))"
        },
        {
          "file": "/var/www/html/vendor/solspace/craft3-calendar/packages/plugin/src/Services/EventsService.php",
          "line": 106,
          "call": "Solspace\\Calendar\\Elements\\Event::buildQuery(array(3))"
        },
        {
          "file": "/var/www/html/vendor/solspace/craft3-calendar/packages/plugin/src/Bundles/GraphQL/Resolvers/EventResolver.php",
          "line": 25,
          "call": "Solspace\\Calendar\\Services\\EventsService::getEventQuery(array(3))"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 624,
          "call": "Solspace\\Calendar\\Bundles\\GraphQL\\Resolvers\\EventResolver::resolve(instance of stdClass, array(3), array(2), instance of GraphQL\\Type\\Definition\\ResolveInfo)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 550,
          "call": "GraphQL\\Executor\\ReferenceExecutor::resolveFieldValueOrError(instance of GraphQL\\Type\\Definition\\FieldDefinition, instance of GraphQL\\Language\\AST\\FieldNode, 'Solspace\\Calendar\\Bundles\\GraphQL\\Resolvers\\EventResolver::resolve', instance of stdClass, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 1196,
          "call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: SolspaceCalendarType, instance of stdClass, instance of ArrayObject(1), array(2))"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 1146,
          "call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: SolspaceCalendarType, instance of stdClass, array(1), instance of ArrayObject(1))"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 1107,
          "call": "GraphQL\\Executor\\ReferenceExecutor::collectAndExecuteSubfields(GraphQLType: SolspaceCalendarType, instance of ArrayObject(1), array(1), instance of stdClass)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 975,
          "call": "GraphQL\\Executor\\ReferenceExecutor::completeObjectValue(GraphQLType: SolspaceCalendarType, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), instance of stdClass)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 790,
          "call": "GraphQL\\Executor\\ReferenceExecutor::completeAbstractValue(GraphQLType: SolspaceCalendarInterface, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), instance of stdClass)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 655,
          "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: SolspaceCalendarInterface, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), instance of stdClass)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 557,
          "call": "GraphQL\\Executor\\ReferenceExecutor::completeValueCatchingError(GraphQLType: SolspaceCalendarInterface, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), instance of stdClass)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 1196,
          "call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: Query, null, instance of ArrayObject(1), array(1))"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 264,
          "call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: Query, null, array(0), instance of ArrayObject(2))"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 215,
          "call": "GraphQL\\Executor\\ReferenceExecutor::executeOperation(instance of GraphQL\\Language\\AST\\OperationDefinitionNode, null)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/Executor.php",
          "line": 156,
          "call": "GraphQL\\Executor\\ReferenceExecutor::doExecute()"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/GraphQL.php",
          "line": 162,
          "call": "GraphQL\\Executor\\Executor::promiseToExecute(instance of GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter, instance of GraphQL\\Type\\Schema, instance of GraphQL\\Language\\AST\\DocumentNode, null, array(2), null, null, null)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/GraphQL.php",
          "line": 94,
          "call": "GraphQL\\GraphQL::promiseToExecute(instance of GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter, instance of GraphQL\\Type\\Schema, '\n{\n\n  entries(type:\"eventCalendarMirror\") {\n    id\n    url\n    title\n  }\n  solspace_calendar {\n    events(site: [\"*\"], loadOccurrences:false) {\n      id\n      url\n      title\n      \n    seomatic(asArray: true) {\n      metaTitleContainer\n    }\n    }\n  }\n}', null, array(2), null, null, null, array(26))"
        },
        {
          "file": "/var/www/html/vendor/craftcms/cms/src/services/Gql.php",
          "line": 546,
          "call": "GraphQL\\GraphQL::executeQuery(instance of GraphQL\\Type\\Schema, '\n{\n\n  entries(type:\"eventCalendarMirror\") {\n    id\n    url\n    title\n  }\n  solspace_calendar {\n    events(site: [\"*\"], loadOccurrences:false) {\n      id\n      url\n      title\n      \n    seomatic(asArray: true) {\n      metaTitleContainer\n    }\n    }\n  }\n}', null, array(2), null, null, null, array(26))"
        },
        {
          "file": "/var/www/html/vendor/craftcms/cms/src/controllers/GraphqlController.php",
          "line": 172,
          "call": "craft\\services\\Gql::executeQuery(instance of craft\\models\\GqlSchema, '\n{\n\n  entries(type:\"eventCalendarMirror\") {\n    id\n    url\n    title\n  }\n  solspace_calendar {\n    events(site: [\"*\"], loadOccurrences:false) {\n      id\n      url\n      title\n      \n    seomatic(asArray: true) {\n      metaTitleContainer\n    }\n    }\n  }\n}', null, null, true)"
        },
        {
          "call": "craft\\controllers\\GraphqlController::actionApi()"
        },
        {
          "file": "/var/www/html/vendor/yiisoft/yii2/base/InlineAction.php",
          "line": 57,
          "function": "call_user_func_array(array(2), array(0))"
        },
        {
          "file": "/var/www/html/vendor/yiisoft/yii2/base/Controller.php",
          "line": 178,
          "call": "yii\\base\\InlineAction::runWithParams(array(1))"
        },
        {
          "file": "/var/www/html/vendor/yiisoft/yii2/base/Module.php",
          "line": 552,
          "call": "yii\\base\\Controller::runAction('api', array(1))"
        },
        {
          "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
          "line": 287,
          "call": "yii\\base\\Module::runAction('graphql/api', array(1))"
        },
        {
          "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
          "line": 596,
          "call": "craft\\web\\Application::runAction('graphql/api', array(1))"
        },
        {
          "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
          "line": 266,
          "call": "craft\\web\\Application::_processActionRequest(instance of craft\\web\\Request)"
        },
        {
          "file": "/var/www/html/vendor/yiisoft/yii2/base/Application.php",
          "line": 384,
          "call": "craft\\web\\Application::handleRequest(instance of craft\\web\\Request)"
        },
        {
          "file": "/var/www/html/web/index.php",
          "line": 27,
          "call": "yii\\base\\Application::run()"
        }
      ]
    }
  ],
  "data": {
    "solspace_calendar": {
      "events": null
    }
  }
}```

from craft-calendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.