@Dheeraj0650
I have not found any support for "self" with GraphQL.
I have researched this looking for a way to accomplish this. I recently gave up and just added my account ID to a configuration file I have so it's available to my code.
I tried "self", "Self", and "SELF" as the id, "self" as the "sis_id". I even tried a empty ID of "". It accepts those, but returns null for the account. The GraphQL id is a base-64 encoded version of "Account-xxx" where xxx is your account number. I tried encoding "Account-self" and using it and it didn't work, either. I even tried it with the legacy nodes. Trying "@self", "#self", and "!self" all threw invalid input errors.
I wouldn't expect most of those variations to work. GraphQL names are case-insensitive and special symbols are used as punctuators. The ID! type, which is what the id property is, is defined as a string but expects a number. The documentation (within the graphiql interface) says "The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID." If "self" were acceptable, then it wouldn't be cacheable (caching appears to be optional).
I looked for alternatives to "self" such as "default." Trying an id of "default" gives an invalid input error.
Trying to leave off the id completely gets you the message that you must specify exactly one of id or sisId.
I looked through the Canvas source code related to GraphQL and didn't find anything related to "self" as an ID. I think these would be handled by the APIs that return the data rather than GraphQL.
I'm not an expert on GraphQL, so it might be possible to add this, but I don't think it's there right now.
I suspect there may be some limitation of GraphQL or the GraphQL library that Canvas is using that makes this non-trivial. For instance, the library may say that anything that looks like a number should be treated as a number and any non-numeric string should be considered as the base-64 encoded ID. To allow recognition of "self" might mean modifying the library and then maintaining those changes rather than just using the base library.